埋点调整
This commit is contained in:
13
bin/pages.js
13
bin/pages.js
@@ -1,6 +1,6 @@
|
|||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
const {chalkTag, findPages, fsExtra, fs} = require("./tools");
|
const {chalkTag, findPages, fsExtra, fs} = require("./tools");
|
||||||
let apps = {list: [], desc: "用于产品库主页面获取应用使用"}
|
let apps = {list: [], desc: "用于产品库主页面获取应用使用", type: "mp"}
|
||||||
const getFileInfo = (app, file) => {
|
const getFileInfo = (app, file) => {
|
||||||
let vue = fs.readFileSync(file).toString()
|
let vue = fs.readFileSync(file).toString()
|
||||||
if (/appName/.test(vue)) {
|
if (/appName/.test(vue)) {
|
||||||
@@ -13,8 +13,15 @@ const getFileInfo = (app, file) => {
|
|||||||
}
|
}
|
||||||
if (/^App/.test(app.name)) {
|
if (/^App/.test(app.name)) {
|
||||||
let {name, label} = app,
|
let {name, label} = app,
|
||||||
path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g,`/mods/$1/$2`)
|
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'})
|
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 => {
|
const saveApps = app => {
|
||||||
|
|||||||
Reference in New Issue
Block a user