vue2-client 1.8.286 → 1.8.288

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": "vue2-client",
3
- "version": "1.8.286",
3
+ "version": "1.8.288",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -26,6 +26,7 @@ const routesConfig = [
26
26
 
27
27
  const options = {
28
28
  mode: 'history',
29
+ base: `/${process.env.VUE_APP_PUBLIC_PATH}/`.replaceAll('//', '/'),
29
30
  routes: parseRoutes(routesConfig, routerMap),
30
31
  config: routesConfig
31
32
  }
@@ -10,6 +10,7 @@ import {
10
10
  import AES from '@vue2-client/utils/EncryptUtil'
11
11
  import Vue from 'vue'
12
12
  import { funcToRouter, loadRoutes } from '@vue2-client/utils/routerUtil'
13
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
13
14
 
14
15
  NProgress.configure({ showSpinner: false })
15
16
 
@@ -49,6 +50,8 @@ const loginGuard = (to, from, next, options) => {
49
50
  const { AESDecrypt } = AES
50
51
  const info = AESDecrypt(token, '3KMKqvgwR8ULbR8Z')
51
52
  const { store, message, router } = options
53
+ // 单页面通常是嵌入到v3的项目中,没有单独的清除按钮,所以需要清除indexedDB
54
+ indexedDB.clear()
52
55
  if (
53
56
  (!loginIgnore.includes(to) || to.name === '404') &&
54
57
  !checkSingleAuthorization('SinglePage', token)
@@ -56,7 +59,7 @@ const loginGuard = (to, from, next, options) => {
56
59
  localStorage.setItem('SinglePage_TOKEN', token)
57
60
  startLogin({
58
61
  ...info,
59
- pathname: window.location.pathname?.startsWith(process.env.VUE_APP_PUBLIC_PATH) ? window.location.pathname.replace(process.env.VUE_APP_PUBLIC_PATH, '') : window.location.pathname,
62
+ pathname: window.location.pathname,
60
63
  store,
61
64
  router,
62
65
  })
@@ -111,7 +111,6 @@ function afterLogin (res, options) {
111
111
  result.functions.unshift(resourceManageMain)
112
112
  afterGeneral(result, options)
113
113
  setAccessToken(data)
114
- indexedDB.clear()
115
114
  if (result.deps === '用户工单登记') {
116
115
  router.push(setting.ticketPage).catch(() => {
117
116
  })