imatrix-ui 0.2.45-up → 0.2.46-up

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imatrix-ui",
3
- "version": "0.2.45-up",
3
+ "version": "0.2.46-up",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
package/src/permission.js CHANGED
@@ -31,7 +31,7 @@ router.beforeEach((to, from, next) => {
31
31
  authApi.setSessionCache(currentRoleKey, to.query[currentRoleKey])
32
32
  }
33
33
  // 是否是开发环境功能
34
- const isDevp = false
34
+ let isDevp = false
35
35
  if(authApi.getSessionCache(devpJWTKey)) {
36
36
  isDevp = true
37
37
  }
@@ -3,6 +3,7 @@ import {
3
3
  getUsername,
4
4
  removeAllLanguages,
5
5
  removeCurrentUser,
6
+ removeDevpPermissions,
6
7
  removeLanguage,
7
8
  removePublishControl,
8
9
  removeToken,
@@ -204,6 +205,7 @@ const user = {
204
205
 
205
206
  removeMenus()
206
207
  removePublishControl()
208
+ removeDevpPermissions()
207
209
  resolve(data)
208
210
  })
209
211
  .catch((error) => {
@@ -227,6 +229,8 @@ const user = {
227
229
  removePermissions()
228
230
 
229
231
  removeMenus()
232
+ removePublishControl()
233
+ removeDevpPermissions()
230
234
 
231
235
  resolve()
232
236
  })
package/src/utils/auth.js CHANGED
@@ -87,3 +87,12 @@ export function removeAllLanguages() {
87
87
  export function removePublishControl() {
88
88
  authApi.removePublishControl()
89
89
  }
90
+ /**
91
+ * 清除开发平台的缓存信息
92
+ */
93
+ export function removeDevpPermissions() {
94
+ let devpJWTKey = '_devpJWT'
95
+ let currentRoleKey = '_CURRENT_ROLE'
96
+ authApi.removeSessionCache(devpJWTKey)
97
+ authApi.removeSessionCache(currentRoleKey)
98
+ }
@@ -104,46 +104,41 @@ export default {
104
104
  },
105
105
  toPath(menu) {
106
106
  const toPathObj = {};
107
- let routePath = menu.fullPath;
108
- if (routePath && routePath.indexOf("?") > 0) {
109
- routePath += "&"
110
- } else {
111
- routePath += "?"
112
- }
113
- if (this.platFrontUrl) {
114
- if (routePath && routePath.indexOf("?") > 0) {
115
- routePath += "&"
116
- } else {
117
- routePath += "?"
107
+ let routePath = menu.fullPath;
108
+ toPathObj.openWay = menu.openWay;
109
+ if (this.isExternalLink(menu.pageType)) {
110
+ if (this.platFrontUrl) {
111
+ if (routePath && routePath.indexOf("?") > 0) {
112
+ routePath += "&"
113
+ } else {
114
+ routePath += "?"
115
+ }
116
+ routePath = routePath + this.platFrontUrl;
118
117
  }
119
- routePath = routePath + this.platFrontUrl;
120
- }
121
- if (this.platBackendUrl) {
122
- if (routePath && routePath.indexOf("?") > 0) {
123
- routePath += "&"
124
- } else {
125
- routePath += "?"
118
+ if (this.platBackendUrl) {
119
+ if (routePath && routePath.indexOf("?") > 0) {
120
+ routePath += "&"
121
+ } else {
122
+ routePath += "?"
123
+ }
124
+ routePath = routePath + this.platBackendUrl;
126
125
  }
127
- routePath = routePath + this.platBackendUrl;
128
- }
129
- if (this.devpJWT) {
130
- if (routePath && routePath.indexOf("?") > 0) {
131
- routePath += "&"
132
- } else {
133
- routePath += "?"
126
+ if (this.devpJWT) {
127
+ if (routePath && routePath.indexOf("?") > 0) {
128
+ routePath += "&"
129
+ } else {
130
+ routePath += "?"
131
+ }
132
+ routePath = routePath + this.devpJWT
134
133
  }
135
- routePath = routePath + this.devpJWT
136
- }
137
- if (this.currentRole) {
138
- if (routePath && routePath.indexOf("?") > 0) {
139
- routePath += "&"
140
- } else {
141
- routePath += "?"
134
+ if (this.currentRole) {
135
+ if (routePath && routePath.indexOf("?") > 0) {
136
+ routePath += "&"
137
+ } else {
138
+ routePath += "?"
139
+ }
140
+ routePath = routePath + this.currentRole
142
141
  }
143
- routePath = routePath + this.currentRole
144
- }
145
- toPathObj.openWay = menu.openWay;
146
- if (this.isExternalLink(menu.pageType)) {
147
142
  toPathObj.path = "/tab-content-iframe-index"
148
143
  toPathObj.tabPath = "/iframe-page/page"
149
144
  toPathObj.query = {};