n20-common-lib 2.8.25 → 2.8.27
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/package.json
CHANGED
|
@@ -714,22 +714,7 @@ export default {
|
|
|
714
714
|
},
|
|
715
715
|
// APP权限申请
|
|
716
716
|
applyForApp() {
|
|
717
|
-
|
|
718
|
-
.prompt(null, 'App权限申请理由', {
|
|
719
|
-
inputType: 'textarea',
|
|
720
|
-
showCancelButton: true,
|
|
721
|
-
confirmButtonText: '确认',
|
|
722
|
-
cancelButtonText: '取消'
|
|
723
|
-
})
|
|
724
|
-
.then(async ({ value }) => {
|
|
725
|
-
const { code, data } = axios.post(
|
|
726
|
-
`/bems/wfUserAppMid/startFlow/{uno}`,
|
|
727
|
-
{ appRemarks: value, uno: this.userNo },
|
|
728
|
-
{
|
|
729
|
-
OperationDesc: '申请APP权限'
|
|
730
|
-
}
|
|
731
|
-
)
|
|
732
|
-
})
|
|
717
|
+
linkPush('/user-web/appAuth')
|
|
733
718
|
},
|
|
734
719
|
|
|
735
720
|
setLang(val) {
|
package/src/utils/auth.js
CHANGED
|
@@ -57,12 +57,15 @@ const auth = {
|
|
|
57
57
|
reqLang = langMap[langKey]
|
|
58
58
|
},
|
|
59
59
|
setHeaders(headers, desc) {
|
|
60
|
-
let OperationDesc =
|
|
61
|
-
|
|
60
|
+
let OperationDesc = 'default'
|
|
61
|
+
let currentMenu = localStorage.getItem('currentMenu')
|
|
62
|
+
if (currentMenu !== 'undefined') {
|
|
63
|
+
OperationDesc = currentMenu
|
|
64
|
+
}
|
|
62
65
|
let token = auth.getToken()
|
|
63
66
|
let defaultHd = {
|
|
64
67
|
Authorization: token ? 'Bearer ' + token : 'Basic TlNUQzpWVkIxVG1sVlVURlNMemxyTkhoc2VtNXdObFJaUVQwOQ==',
|
|
65
|
-
OperationDesc: desc ? encodeURI(desc) :
|
|
68
|
+
OperationDesc: desc ? encodeURI(desc) : encodeURI(OperationDesc),
|
|
66
69
|
timestamp: Date.now(),
|
|
67
70
|
requestKey: Date.now(),
|
|
68
71
|
lang: reqLang
|
package/src/utils/handleTab.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import monitor from './monitor'
|
|
2
|
+
|
|
1
3
|
// 操作切换路由生成的页签
|
|
2
4
|
const dN = process.env.VUE_APP_NAME
|
|
3
5
|
/** 打开页签,push对应路由 */
|
|
@@ -78,6 +80,8 @@ function getName(baseUrl) {
|
|
|
78
80
|
/** 子模块在门户中打开页签 */
|
|
79
81
|
export function setTabs(baseUrl, to, tab = true) {
|
|
80
82
|
let { path, name, meta = {}, query } = to
|
|
83
|
+
monitor.setCurrentRoute(meta?.desc || meta?.title)
|
|
84
|
+
|
|
81
85
|
let { i18n, title } = getI18n(meta, name)
|
|
82
86
|
let route = getPath(baseUrl, path)
|
|
83
87
|
|
package/src/utils/monitor.js
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
// 监控类 用户点击菜单时记录当前菜单,用于统一请求体的OperationDesc
|
|
2
2
|
class Monitor {
|
|
3
3
|
constructor(opt) {
|
|
4
|
-
this.
|
|
5
|
-
this.
|
|
4
|
+
this.options = opt
|
|
5
|
+
this._init()
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
this.
|
|
7
|
+
_init() {
|
|
8
|
+
this._clickEvent()
|
|
9
9
|
}
|
|
10
10
|
setRouter(router) {
|
|
11
11
|
this.router = router
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
setCurrentRoute(value) {
|
|
14
|
+
this.desc = value
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getCurrentRoute() {
|
|
18
|
+
return this.router?.currentRoute
|
|
19
|
+
}
|
|
20
|
+
_clickEvent() {
|
|
14
21
|
// 监听点击事件
|
|
15
22
|
document.addEventListener('click', (e) => {
|
|
16
|
-
const currentMenu = this.
|
|
23
|
+
const currentMenu = this.getCurrentRoute()
|
|
17
24
|
if (currentMenu) {
|
|
18
|
-
const { meta } = currentMenu
|
|
19
|
-
|
|
25
|
+
const { meta } = currentMenu || {}
|
|
26
|
+
if (this.desc || meta?.desc) {
|
|
27
|
+
window.localStorage.setItem('currentMenu', this.desc || meta?.desc)
|
|
28
|
+
}
|
|
20
29
|
}
|
|
21
30
|
})
|
|
22
31
|
}
|