xs-common-plugins 1.3.5 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/UniappTool.xml +10 -0
- package/README.md +7 -0
- package/package.json +1 -1
- package/src/components/Search/methods.js +2 -1
- package/src/router/ca.js +23 -0
- package/src/router/permission.js +7 -0
- package/src/router/tracker.js +19 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="cn.fjdmy.uniapp.UniappProjectDataService">
|
|
4
|
+
<option name="generalBasePath" value="$PROJECT_DIR$" />
|
|
5
|
+
<option name="manifestPath" value="$PROJECT_DIR$/manifest.json" />
|
|
6
|
+
<option name="pagesPath" value="$PROJECT_DIR$/pages.json" />
|
|
7
|
+
<option name="scanNum" value="1" />
|
|
8
|
+
<option name="type" value="store" />
|
|
9
|
+
</component>
|
|
10
|
+
</project>
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -63,10 +63,11 @@ export default {
|
|
|
63
63
|
|
|
64
64
|
//报表名称按钮点击
|
|
65
65
|
clickReportBtn(url, param) {
|
|
66
|
+
if(param.id == undefined) return
|
|
66
67
|
const that = this;
|
|
67
68
|
this.$http.get(url, param).then(res => {
|
|
68
|
-
this.reportList = res.data;
|
|
69
69
|
if (res.data.length > 0) {
|
|
70
|
+
this.reportList = res.data;
|
|
70
71
|
that.handlerSelReport(res.data[0])
|
|
71
72
|
that.toSearch();
|
|
72
73
|
}
|
package/src/router/ca.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import tracker from "./tracker";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
export default function trackerSend({userName, router = {}, clientId}) {
|
|
4
|
+
tracker.send({
|
|
5
|
+
title: "页面访问",
|
|
6
|
+
action: "后台页面路由跳转",
|
|
7
|
+
url: location.href,
|
|
8
|
+
qt: {
|
|
9
|
+
clientId,
|
|
10
|
+
userName,
|
|
11
|
+
date: moment(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
|
|
12
|
+
fullPath: router.fullPath,
|
|
13
|
+
title: getRouterBreadcrumbs(router)
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getRouterBreadcrumbs(router) {
|
|
19
|
+
return router.matched
|
|
20
|
+
.map((item) => (item.meta && item.meta.title) || item.name)
|
|
21
|
+
.filter((item) => item && item !== "首页")
|
|
22
|
+
.join(" > ");
|
|
23
|
+
}
|
package/src/router/permission.js
CHANGED
|
@@ -10,6 +10,7 @@ import "nprogress/nprogress.css"; // progress bar style
|
|
|
10
10
|
import Oidc from "oidc-client";
|
|
11
11
|
import { requestApi as HTTP } from "xs-request";
|
|
12
12
|
import router from "./index";
|
|
13
|
+
import trackerSend from "./ca";
|
|
13
14
|
|
|
14
15
|
NProgress.configure({
|
|
15
16
|
showSpinner: false,
|
|
@@ -70,6 +71,12 @@ router.beforeEach((to, from, next) => {
|
|
|
70
71
|
toLoginPage(to, next);
|
|
71
72
|
|
|
72
73
|
} // 没登录 & 没在登录页 => 跳转到登录页
|
|
74
|
+
|
|
75
|
+
trackerSend({
|
|
76
|
+
clientId: id4config.client_id,
|
|
77
|
+
userName: getToken("LoginUserName"),
|
|
78
|
+
router: to
|
|
79
|
+
})
|
|
73
80
|
});
|
|
74
81
|
|
|
75
82
|
router.afterEach(() => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import SlsTracker from '@aliyun-sls/web-track-browser'
|
|
2
|
+
|
|
3
|
+
const opts = {
|
|
4
|
+
host: 'cn-hangzhou.log.aliyuncs.com', // 所在地域的服务入口。例如cn-hangzhou.log.aliyuncs.com
|
|
5
|
+
project: 'xsmddata', // Project名称。
|
|
6
|
+
logstore: 'mddata', // Logstore名称。
|
|
7
|
+
time: 1, // 发送日志的时间间隔,默认是10秒。
|
|
8
|
+
count: 10, // 发送日志的数量大小,默认是10条。
|
|
9
|
+
topic: 'msg', // 自定义日志主题。
|
|
10
|
+
source: '后台管理系统',
|
|
11
|
+
tags: {
|
|
12
|
+
'version': '1.0.0'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const tracker = new SlsTracker(opts)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export default tracker
|