imatrix-ui 2.9.41-dw-tmp2 → 2.9.43-dw

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": "2.9.41-dw-tmp2",
3
+ "version": "2.9.43-dw",
4
4
  "description": "前端组件库:表格、表单、组织结构树等",
5
5
  "main": "lib/super-ui.umd.min.js",
6
6
  "private": false,
@@ -77,8 +77,7 @@ const cn = {
77
77
  asyncExport: '正在异步导出,请等待消息通知!',
78
78
  selectedWorkingGroup: '已选工作组',
79
79
  forbiddenExceptionLinkUrl: '请点击进行权限申请',
80
- forbiddenExceptionLinkUser: '如有疑问请联系',
81
- systemCacheVersionNotEqual: '{systemCode}系统发版了新版本,系统会自动刷新页面'
80
+ forbiddenExceptionLinkUser: '如有疑问请联系'
82
81
  },
83
82
  // 列表组件
84
83
  superGrid: {
@@ -77,8 +77,7 @@ const en = {
77
77
  asyncExport: 'Asynchronous export, please wait for message notification!',
78
78
  selectedWorkingGroup: 'Selected working group',
79
79
  forbiddenExceptionLinkUrl: 'please click to apply',
80
- forbiddenExceptionLinkUser: 'if you have any questions,please contact',
81
- systemCacheVersionNotEqual: '{systemCode} System has released a new version, and the page will automatically refresh'
80
+ forbiddenExceptionLinkUser: 'if you have any questions,please contact'
82
81
  },
83
82
  superGrid: {
84
83
  columnConfig: 'Column Config',
package/src/permission.js CHANGED
@@ -6,7 +6,6 @@ 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'
10
9
 
11
10
  const whiteList = ['/login', '/update-password', '/forget-password', '/reset-password', '/redirect'] // 不重定向白名单
12
11
  router.beforeEach((to, from, next) => {
@@ -1,9 +1,6 @@
1
1
  import sessionStorage from 'sessionstorage'
2
2
  import Vue from 'vue'
3
3
  import { getToken, getLanguage, getAllLanguages, setAllLanguages } from './auth'
4
- import {
5
- getI18n
6
- } from './util'
7
4
  /**
8
5
  * 获得相对地址
9
6
  */
@@ -338,68 +335,3 @@ export function cacheCurrentLanguageUtil(http) {
338
335
  }
339
336
  })
340
337
  }
341
-
342
- // 验证系统版本,确定是否需要重新加载
343
- export function validateCacheVersion() {
344
- // 将自定义系统编码放入header中
345
- const customSystem = Vue.prototype.systemCode
346
- console.log('validateCacheVersion----customSystem=', customSystem)
347
- if (customSystem) {
348
- const cacheVersion = localStorage.getItem('VUE_APP_VERSION_' + customSystem)
349
- console.log('validateCacheVersion----cacheVersion=', cacheVersion)
350
- if (process.env.VUE_APP_VERSION && cacheVersion && cacheVersion !== process.env.VUE_APP_VERSION) {
351
- // 表示缓存的版本和当前发布的版本不一致,需要清除缓存
352
- console.log('validateCacheVersion----1111----')
353
- const message = getI18n().t('imatrixUIMessage.systemCacheVersionNotEqual', { systemCode: customSystem })
354
- alert(message)
355
- clearBrowserCache(customSystem)
356
- } else if (process.env.VUE_APP_VERSION) {
357
- // 表示缓存的版本和当前发布的版本一致,或cacheVersion是空,表示没有缓存过
358
- console.log('validateCacheVersion----2222----')
359
- localStorage.setItem('VUE_APP_VERSION_' + customSystem, process.env.VUE_APP_VERSION)
360
- }
361
- }
362
- }
363
-
364
- function clearCache() {
365
- const version = process.env.VUE_APP_VERSION
366
- // 获取所有需要清除缓存的元素,如图片、CSS文件、JavaScript文件等
367
- const elements = document.getElementsByTagName('link')
368
- for (let i = 0; i < elements.length; i++) {
369
- const element = elements[i]
370
- console.log('elementLink[', i, ']', element)
371
- // 将资源的URL后面加上缓存版本号
372
- element.href = element.href + '?v=' + version
373
- }
374
-
375
- // 同样的方法清除JavaScript文件的缓存
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
381
- }
382
-
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
- // }
389
- }
390
-
391
- function redirectToCurrentPage() {
392
- // 重定向到当前页面
393
- window.location.reload()
394
- }
395
-
396
- // 重新加载页面
397
- export function clearBrowserCache(customSystem) {
398
- // 调用清除缓存的方法
399
- clearCache()
400
- // 调用重定向到当前页面的方法
401
- redirectToCurrentPage()
402
- if (customSystem) {
403
- localStorage.setItem('VUE_APP_VERSION_' + customSystem, process.env.VUE_APP_VERSION)
404
- }
405
- }
@@ -1,7 +1,7 @@
1
1
  import axios from 'axios'
2
2
  import {
3
3
  Message
4
- } from '@gcommon/gcommon-ui'
4
+ } from 'element-ui'
5
5
  import {
6
6
  getToken,
7
7
  removeToken
@@ -142,12 +142,35 @@ service.interceptors.response.use(
142
142
  if (error.response.data && error.response.data.message) {
143
143
  message = error.response.data.message
144
144
  }
145
- Message({
146
- showClose: true,
147
- message: message,
148
- type: 'error',
149
- duration: 5 * 1000
150
- })
145
+ let isHtml = 'false'
146
+ let htmlMsg
147
+ try {
148
+ const msgObj = JSON.parse(message)
149
+ isHtml = msgObj['htmlFlag']
150
+ htmlMsg = msgObj['message']
151
+ } catch (error) {
152
+ console.log('message is not JSON')
153
+ }
154
+ if (isHtml !== undefined && isHtml === 'true') {
155
+ // 表示显示html片段
156
+ Message({
157
+ dangerouslyUseHTMLString: true,
158
+ showClose: true,
159
+ message: htmlMsg,
160
+ type: 'error',
161
+ duration: 5 * 1000
162
+ })
163
+ } else {
164
+ if (htmlMsg) {
165
+ message = htmlMsg
166
+ }
167
+ Message({
168
+ showClose: true,
169
+ message: message,
170
+ type: 'error',
171
+ duration: 5 * 1000
172
+ })
173
+ }
151
174
  return Promise.reject(error)
152
175
  } else {
153
176
  let message = error.message