diff --git a/bin/appsSync.js b/bin/appsSync.js index 8e63bbca..9ab5d455 100644 --- a/bin/appsSync.js +++ b/bin/appsSync.js @@ -3,7 +3,7 @@ const {chalkTag, findApp, fs} = require("./tools"); const compiler = require('vue-template-compiler') const saveApps = app => { if (app.list.length > 0) { - return axios.post("http://dvcp.sinoecare.net/node/wechatapps/addOrUpdate", app, {timeout: 1000}).then(res => { + return axios.post("http://192.168.1.87:12525/node/wechatapps/addOrUpdate", app, {timeout: 1000}).then(res => { if (res.data.code == 0) chalkTag.done("产品库目录已同步至后台数据库...") }).catch(() => 0) } else return Promise.reject("没有应用") diff --git a/project/oms/apps/sentry/AppApiMonitor/AppApiMonitor.vue b/project/oms/apps/sentry/AppApiMonitor/AppApiMonitor.vue index f5489ce1..fd808bf4 100644 --- a/project/oms/apps/sentry/AppApiMonitor/AppApiMonitor.vue +++ b/project/oms/apps/sentry/AppApiMonitor/AppApiMonitor.vue @@ -4,13 +4,21 @@ @@ -19,26 +27,57 @@ diff --git a/project/tongren/AppAccountTr/AppAccountTr.vue b/project/tongren/AppAccountTr/AppAccountTr.vue new file mode 100644 index 00000000..4c8aa38d --- /dev/null +++ b/project/tongren/AppAccountTr/AppAccountTr.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/project/tongren/AppSignInfo/AppSignInfo.vue b/project/tongren/AppSignInfo/AppSignInfo.vue new file mode 100644 index 00000000..789573e2 --- /dev/null +++ b/project/tongren/AppSignInfo/AppSignInfo.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/project/tongren/AppSignInfo/list.vue b/project/tongren/AppSignInfo/list.vue new file mode 100644 index 00000000..46906462 --- /dev/null +++ b/project/tongren/AppSignInfo/list.vue @@ -0,0 +1,158 @@ + + + + + diff --git a/ui/lib/js/observer.js b/ui/lib/js/observer.js new file mode 100644 index 00000000..d899ab73 --- /dev/null +++ b/ui/lib/js/observer.js @@ -0,0 +1,39 @@ +/** + * 获取符合要求的请求 + * @param entries 监测的请求对象 + * @param type 设置满足条件的请求类型 + * @returns {PerformanceEntry[]} + */ +const getRequests = (entries = performance.getEntriesByType('resource'), type = ['xmlhttprequest']) => + entries?.filter(e => type.includes(e.initiatorType)) || [] + +/** + * 观察者工具对象,用于前端接口监测 + */ +class Observer { + constructor() { + this.saveLogs(getRequests()) + this.ins = new PerformanceObserver((list, ob) => { + const watchLogs = getRequests(list.getEntriesByType("resource")) + this.saveLogs(watchLogs) + }) + this.ins.observe({entryTypes: ["resource"]}) + } + + saveLogs(list = []) { + list.map(e => { + if (!/sockjs/.test(e.name)) { + const api = { + status: e.responseStatus, + path: e.name, + url: location.href, + nodeProcess: process.env.NODE_ENV, + } + console.log(api) + // http.post("/node/monitorApi/addOrUpdate", api) + } + }) + } +} + +export default Observer