埋点调整

This commit is contained in:
aixianling
2022-06-08 16:32:01 +08:00
parent 2198e6e6f2
commit d71028399a

View File

@@ -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 => {