From 0ffed95b87ecac4a5310ec3e179041d41edf77e9 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 6 Dec 2022 09:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=A6=BB=E7=BA=BF=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + bin/serve.js | 4 ++-- src/App.vue | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index daa5353f..552e3fd4 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ yarn-error.log* /package-lock.json /.hbuilderx/launch.json /src/pages.json +/src/config.json diff --git a/bin/serve.js b/bin/serve.js index 13057bf8..cd6f5fd3 100644 --- a/bin/serve.js +++ b/bin/serve.js @@ -13,7 +13,7 @@ const getFileInfo = (app, file) => { } if (/^App/.test(app.name) && app.label) { let {name, label} = app, - path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`) + path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`) apps.list.push({ id: file.replace(/\.\/?(vue)?/g, '').replace(/[\\\/]/g, '_'), name, @@ -28,7 +28,7 @@ const saveApps = app => { if (app.list.length > 0) { axios.post("http://dvcp.sinoecare.net/node/wechatapps/addOrUpdate", app, {timeout: 1000}).then(res => { if (res.data.code == 0) chalkTag.done("产品库目录已同步至后台数据库...") - }).catch(err => 0) + }).catch(err => 0).finally(() => fsExtra.outputJson('src/config.json', {apps: app.list})) } } diff --git a/src/App.vue b/src/App.vue index 2fdfc104..5979fe95 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,6 @@