埋点调整
This commit is contained in:
		| @@ -1,6 +1,6 @@ | |||||||
| const {chalkTag, findPages, fs, fsExtra} = require("./tools"); | const {chalkTag, findPages, fs, fsExtra} = require("./tools"); | ||||||
| const axios = require("axios"); | const axios = require("axios"); | ||||||
| let apps = {list: [], desc: "用于产品库主页面获取应用使用"} | let apps = {list: [], desc: "用于产品库主页面获取应用使用", type: 'wxwork'} | ||||||
| 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)) { | ||||||
| @@ -11,7 +11,7 @@ const getFileInfo = (app, file) => { | |||||||
|     } else |     } else | ||||||
|       app.style = {navigationBarTitleText: app.label} |       app.style = {navigationBarTitleText: app.label} | ||||||
|   } |   } | ||||||
|   if (/^App/.test(app.name)) { |   if (/^App/.test(app.name) && app.label) { | ||||||
|     let {name, label} = app, |     let {name, label} = app, | ||||||
|         path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`) |         path = app.path.replace(/.+[\\\/]([^\\\/]+)[\\\/]([^\\\/]+)$/g, `/apps/$1/$2`) | ||||||
|     apps.list.push({ |     apps.list.push({ | ||||||
| @@ -27,7 +27,7 @@ const getFileInfo = (app, file) => { | |||||||
| const saveApps = app => { | const saveApps = app => { | ||||||
|   if (app.list.length > 0) { |   if (app.list.length > 0) { | ||||||
|     axios.post("http://192.168.1.87:12525/node/wechatapps/addOrUpdate", app, {timeout: 1000}).then(res => { |     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 => { |     }).catch(err => { | ||||||
|       console.log(err) |       console.log(err) | ||||||
|     }) |     }) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user