From 8603d77a9d41ec9bd9e1f2db13e84b3d55f28874 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Thu, 28 Jul 2022 16:26:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=83=E7=89=9B=E5=9C=B0=E5=9D=80=E4=BC=A0?= =?UTF-8?q?=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/src/layout/actions/global.js | 1 + web/config.js | 3 ++- web/package.json | 2 +- web/routes/attachment/index.js | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web/client/src/layout/actions/global.js b/web/client/src/layout/actions/global.js index 1ac081a5..c7c82fc3 100644 --- a/web/client/src/layout/actions/global.js +++ b/web/client/src/layout/actions/global.js @@ -31,6 +31,7 @@ export function initApiRoot () { return dispatch => { RouteRequest.get(RouteTable.apiRoot).then(res => { localStorage.setItem('tyApiRoot', res.root); + localStorage.setItem('qndmn', res.qndmn); dispatch({ type: INIT_API_ROOT, payload: { diff --git a/web/config.js b/web/config.js index 20df1b7f..0736a5c0 100644 --- a/web/config.js +++ b/web/config.js @@ -16,7 +16,7 @@ dev && console.log('\x1B[33m%s\x1b[0m', '请遵循并及时更新 readme.md, args.option(['p', 'port'], '启动端口'); args.option(['u', 'api-url'], 'webapi的URL'); args.option(['r', 'report-node'], '报表进程地址'); -args.option(['r', 'report-node'], '报表进程地址'); +args.option('qndmn', '七牛'); const flags = args.parse(process.argv); const FS_UNIAPP_API = process.env.FS_UNIAPP_API || flags.apiUrl; @@ -53,6 +53,7 @@ const product = { entry: require('./routes').entry, opts: { apiUrl: FS_UNIAPP_API, + qndmn: QINIU_DOMAIN_QNDMN_RESOURCE, staticRoot: './client', } }, { diff --git a/web/package.json b/web/package.json index db30d3bf..3f139646 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 5000 -u http://10.8.30.7:14000", + "start-params": "node server -p 5000 -u http://10.8.30.7:14000 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com", "deploy": "export NODE_ENV=production&&npm run color && 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", diff --git a/web/routes/attachment/index.js b/web/routes/attachment/index.js index e0f140cf..08b8e007 100644 --- a/web/routes/attachment/index.js +++ b/web/routes/attachment/index.js @@ -18,9 +18,9 @@ const ext = { module.exports = { entry: function (app, router, opts) { const getApiRoot = async function (ctx) { - const { apiUrl } = opts; + const { apiUrl, qndmn } = opts; ctx.status = 200; - ctx.body = { root: apiUrl }; + ctx.body = { root: apiUrl, qndmn }; }; let upload = async function (ctx, next) {