bk-cmdb icon indicating copy to clipboard operation
bk-cmdb copied to clipboard

UI 源码启动配置问题咨询

Open Jeremy-boo opened this issue 4 months ago • 3 comments

请教一个 ui 源码启动问题,现在后端都通过源码启动成功,但是在启动前端的时候,npm install 以及 npm run dev 启动都没有问题,也没有任何报错信息;

但是访问 localhost:9090 的出现空白页面前端加载不出来

Image

./cmdb_manager.sh status [CMDB-Manager] CMDB 组件运行状态:

adminserver 运行中 (PID: 91036, 端口: 60004) coreservice 运行中 (PID: 91105, 端口: 50009) apiserver 运行中 (PID: 91156, 端口: 8080) cloudserver 运行中 (PID: 91193, 端口: 60013) datacollection 运行中 (PID: 91242, 端口: 60005) eventserver 运行中 (PID: 91311, 端口: 60009) hostserver 运行中 (PID: 91362, 端口: 60001) operationserver 运行中 (PID: 91403, 端口: 60011) procserver 运行中 (PID: 91451, 端口: 60003) taskserver 运行中 (PID: 91489, 端口: 60012) toposerver 运行中 (PID: 91533, 端口: 60002) transferservice 运行中 (PID: 91585, 端口: 50011) webserver 运行中 (PID: 91638, 端口: 8083)

后端组件的端口如下,针对前端这里的配置修改成 8083 以及 8080 都不行

config: Object.assign({}, config, { API_URL: JSON.stringify('http://127.0.0.1:8083/'), API_VERSION: JSON.stringify('v3'), API_LOGIN: JSON.stringify('http://127.0.0.1:8083/login'), AGENT_URL: JSON.stringify(''), AUTH_SCHEME: JSON.stringify('internal'), AUTH_CENTER: JSON.stringify({}), BUILD_VERSION: JSON.stringify('dev'), USER_ROLE: JSON.stringify(1), USER_NAME: JSON.stringify('admin'), FULL_TEXT_SEARCH: JSON.stringify('off'), USER_MANAGE: JSON.stringify(''), HELP_DOC_URL: JSON.stringify(''), DISABLE_OPERATION_STATISTIC: false, COOKIE_DOMAIN: JSON.stringify(''), COMPONENT_API_URL: JSON.stringify(''), PUBLIC_PATH: JSON.stringify('/'), ENABLE_NOTIFICATION: JSON.stringify(false), BK_REPO_URL: JSON.stringify(''), SHARED_RES_URL: JSON.stringify('') }),

// Paths assetsSubDirectory: '', assetsPublicPath: '/static/', proxyTable: [

{ context: ['/proxy'], logLevel: 'info', changeOrigin: true, target: 'http://127.0.0.1:8083/', pathRewrite: { '^/proxy': '' } } ],

针对开发模式下,前端这里应该如何配置?

如果 我把login url 设置成:http://127.0.0.1:8083/login/?app_id=%s&c_url=%s

这里直接就跳转转到 后端 web_server 服务启动的前端页面去了,导致ui 启动的源码无效

Jeremy-boo avatar Aug 15 '25 03:08 Jeremy-boo

上面为什么访问端口9090呢?应该是webserver监听的端口8083

Anna-shine avatar Aug 27 '25 08:08 Anna-shine

上面为什么访问端口9090呢?应该是webserver监听的端口8083

使用 npm run dev 启动的 ui 源码,ui 配置里面配置前端代码为 9090

Jeremy-boo avatar Aug 27 '25 08:08 Jeremy-boo

@yangyy

Anna-shine avatar Sep 28 '25 01:09 Anna-shine