Browse Source

去除不需要的参数

master
wenlele 2 years ago
parent
commit
dce88b7aa4
  1. 12
      web/config.js
  2. 2
      web/package.json

12
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,// 静态信息

2
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"

Loading…
Cancel
Save