From d71028399aacafde9c97190a60324dfd6679395c Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 8 Jun 2022 16:32:01 +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/pages.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/pages.js b/bin/pages.js index 1c3bebe..0ccbbb7 100644 --- a/bin/pages.js +++ b/bin/pages.js @@ -1,6 +1,6 @@ const axios = require('axios') const {chalkTag, findPages, fsExtra, fs} = require("./tools"); -let apps = {list: [], desc: "用于产品库主页面获取应用使用"} +let apps = {list: [], desc: "用于产品库主页面获取应用使用", type: "mp"} const getFileInfo = (app, file) => { let vue = fs.readFileSync(file).toString() if (/appName/.test(vue)) { @@ -13,8 +13,15 @@ const getFileInfo = (app, file) => { } if (/^App/.test(app.name)) { let {name, label} = app, - path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g,`/mods/$1/$2`) - apps.list.push({id: file.replace(/\.\/?(vue)?/g, '')?.replace(/[\\\/]/g,'_'), name, label, path, libPath: file?.replace(/\\/g, '/')?.replace(/^src(\/.+)\.vue/, '$1'),type:'mp'}) + path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/mods/$1/$2`) + apps.list.push({ + id: file.replace(/\.\/?(vue)?/g, '')?.replace(/[\\\/]/g, '_'), + name, + label, + path, + libPath: file?.replace(/\\/g, '/')?.replace(/^src(\/.+)\.vue/, '$1'), + type: 'mp' + }) } } const saveApps = app => {