diff --git a/web/config.js b/web/config.js index 2d28471..ea80bd4 100644 --- a/web/config.js +++ b/web/config.js @@ -15,20 +15,16 @@ dev && console.log('\x1B[33m%s\x1b[0m', '请遵循并及时更新 readme.md, // // 启动参数 args.option(['p', 'port'], '启动端口'); args.option(['u', 'api-url'], 'webapi的URL'); -args.option('apiAnxinyunUrl', "安心云api"); -args.option('axyProject', '安心云泵站项目信息'); + const flags = args.parse(process.argv); const FS_UNIAPP_API = process.env.FS_UNIAPP_API || flags.apiUrl; -const API_ANXINYUN_URL = process.env.API_ANXINYUN_URL || flags.apiAnxinyunUrl -const AXY_BZ_PROJECT = process.env.AXY_BZ_PROJECT || flags.axyProject if ( !FS_UNIAPP_API - || !API_ANXINYUN_URL ) { console.log('缺少启动参数,异常退出'); args.showHelp(); @@ -47,8 +43,7 @@ const product = { }, { entry: require('./middlewares/proxy').entry, opts: { - host: API_ANXINYUN_URL, - match: /^\/_axy\//, + } }, { entry: require('./middlewares/attachment').entry, @@ -59,8 +54,7 @@ const product = { }, { entry: require('./routes').entry, opts: { - axyApi: API_ANXINYUN_URL, - axyProject: AXY_BZ_PROJECT + } }, { entry: require('./client').entry,// 静态信息 diff --git a/web/package.json b/web/package.json index a1e17ed..36047ba 100644 --- a/web/package.json +++ b/web/package.json @@ -6,7 +6,7 @@ "scripts": { "test": "mocha", "start": "cross-env NODE_ENV=development npm run start-params", - "start-params": "node server -p 5900 -u http://127.0.0.1:4900 --apiAnxinyunUrl https://openapi.anxinyun.cn/api/v1 --axyProject 1a271f12-52f2-4d16-8dad-ec0c92d3e0cc/03bzzdh/123456", + "start-params": "node server -p 5900 -u http://127.0.0.1:4900", "deploy": "export NODE_ENV=production && npm run build && node server", "build-dev": "export NODE_ENV=development&&webpack --config webpack.config.js", "build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js"