From b92e61f63480f990b3366053ae3af598fc0e54a1 Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 8 Jun 2022 16:32:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/serve.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/serve.js b/bin/serve.js index a9cbf775..16450075 100644 --- a/bin/serve.js +++ b/bin/serve.js @@ -1,6 +1,6 @@ const {chalkTag, findPages, fs, fsExtra} = require("./tools"); const axios = require("axios"); -let apps = {list: [], desc: "用于产品库主页面获取应用使用"} +let apps = {list: [], desc: "用于产品库主页面获取应用使用", type: 'wxwork'} const getFileInfo = (app, file) => { let vue = fs.readFileSync(file).toString() if (/appName/.test(vue)) { @@ -11,7 +11,7 @@ const getFileInfo = (app, file) => { } else app.style = {navigationBarTitleText: app.label} } - if (/^App/.test(app.name)) { + if (/^App/.test(app.name) && app.label) { let {name, label} = app, path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`) apps.list.push({ @@ -27,7 +27,7 @@ const getFileInfo = (app, file) => { const saveApps = app => { if (app.list.length > 0) { axios.post("http://192.168.1.87:12525/node/wechatapps/addOrUpdate", app, {timeout: 1000}).then(res => { - if (res.code == 0) chalkTag.done("产品库目录已同步至后台数据库...") + if (res.data.code == 0) chalkTag.done("产品库目录已同步至后台数据库...") }).catch(err => { console.log(err) })