imatrix-ui 2.9.41-dw-tmp1 → 2.9.41-dw-tmp2
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 +1 -1
- package/src/permission.js +1 -2
- package/src/utils/common-util.js +14 -12
package/package.json
CHANGED
package/src/permission.js
CHANGED
|
@@ -6,11 +6,10 @@ import router, { errorRouterMap } from './router'
|
|
|
6
6
|
NProgress.configure({ showSpinner: false })// NProgress Configuration
|
|
7
7
|
import { Message } from '@gcommon/gcommon-ui'
|
|
8
8
|
import Vue from 'vue'
|
|
9
|
-
import { validateCacheVersion } from './utils/common-util'
|
|
9
|
+
// import { validateCacheVersion } from './utils/common-util'
|
|
10
10
|
|
|
11
11
|
const whiteList = ['/login', '/update-password', '/forget-password', '/reset-password', '/redirect'] // 不重定向白名单
|
|
12
12
|
router.beforeEach((to, from, next) => {
|
|
13
|
-
validateCacheVersion()
|
|
14
13
|
NProgress.start()
|
|
15
14
|
// console.log('router.beforeEach-to=', to)
|
|
16
15
|
// console.log('router.beforeEach-from=', from)
|
package/src/utils/common-util.js
CHANGED
|
@@ -342,7 +342,7 @@ export function cacheCurrentLanguageUtil(http) {
|
|
|
342
342
|
// 验证系统版本,确定是否需要重新加载
|
|
343
343
|
export function validateCacheVersion() {
|
|
344
344
|
// 将自定义系统编码放入header中
|
|
345
|
-
const customSystem = Vue.prototype.
|
|
345
|
+
const customSystem = Vue.prototype.systemCode
|
|
346
346
|
console.log('validateCacheVersion----customSystem=', customSystem)
|
|
347
347
|
if (customSystem) {
|
|
348
348
|
const cacheVersion = localStorage.getItem('VUE_APP_VERSION_' + customSystem)
|
|
@@ -364,26 +364,28 @@ export function validateCacheVersion() {
|
|
|
364
364
|
function clearCache() {
|
|
365
365
|
const version = process.env.VUE_APP_VERSION
|
|
366
366
|
// 获取所有需要清除缓存的元素,如图片、CSS文件、JavaScript文件等
|
|
367
|
-
|
|
367
|
+
const elements = document.getElementsByTagName('link')
|
|
368
368
|
for (let i = 0; i < elements.length; i++) {
|
|
369
369
|
const element = elements[i]
|
|
370
|
+
console.log('elementLink[', i, ']', element)
|
|
370
371
|
// 将资源的URL后面加上缓存版本号
|
|
371
372
|
element.href = element.href + '?v=' + version
|
|
372
373
|
}
|
|
373
374
|
|
|
374
375
|
// 同样的方法清除JavaScript文件的缓存
|
|
375
|
-
|
|
376
|
-
for (let i = 0; i <
|
|
377
|
-
const
|
|
378
|
-
|
|
376
|
+
const elementsScripts = document.getElementsByTagName('script')
|
|
377
|
+
for (let i = 0; i < elementsScripts.length; i++) {
|
|
378
|
+
const elementScript = elementsScripts[i]
|
|
379
|
+
console.log('elementScript[', i, ']', elementScript)
|
|
380
|
+
elementScript.src = elementScript.src + '?v=' + version
|
|
379
381
|
}
|
|
380
382
|
|
|
381
|
-
// 清除图片的缓存
|
|
382
|
-
elements = document.getElementsByTagName('img')
|
|
383
|
-
for (let i = 0; i < elements.length; i++) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
383
|
+
// // 清除图片的缓存
|
|
384
|
+
// elements = document.getElementsByTagName('img')
|
|
385
|
+
// for (let i = 0; i < elements.length; i++) {
|
|
386
|
+
// const element = elements[i]
|
|
387
|
+
// element.src = element.src + '?v=' + version
|
|
388
|
+
// }
|
|
387
389
|
}
|
|
388
390
|
|
|
389
391
|
function redirectToCurrentPage() {
|