af-mobile-client-vue3 1.1.24 → 1.1.26

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,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.1.24",
4
+ "version": "1.1.26",
5
5
  "description": "Vue + Vite component lib",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -4,8 +4,8 @@ import { showToast } from 'vant'
4
4
 
5
5
  // 不需要登录拦截的路由配置
6
6
  const loginIgnore = {
7
- names: ['404', '403'], // 根据路由名称匹配
8
- paths: ['/login', '/XReportFormIframeView', '/invoiceShow', '/user-appointment', '/appointment-form', '/appointment-history'], // 根据路由fullPath匹配
7
+ names: ['404', '403', 'user-appointment', 'appointment-form', 'appointment-history'], // 根据路由名称匹配
8
+ paths: ['/login', '/XReportFormIframeView', '/invoiceShow'], // 根据路由fullPath匹配
9
9
  /**
10
10
  * 判断路由是否包含在该配置中
11
11
  * @param route vue-router 的 route 对象
@@ -22,14 +22,17 @@ const loginIgnore = {
22
22
  * @param next
23
23
  */
24
24
  function loginGuard(to, from, next?) {
25
+ console.log('登录守卫==to', to)
26
+ console.log('登录守卫==from', from)
25
27
  if (!loginIgnore.includes(to) && !useUserStore().getToken()) {
26
28
  showToast({
27
- message: '登录态已失效,请重新登录',
29
+ message: '登录状态已失效,请重新登录!',
28
30
  position: 'bottom',
29
31
  })
30
32
  next({ path: '/login' })
31
33
  }
32
34
  else {
35
+ console.log('跳过了', useUserStore().getToken())
33
36
  if (to.path === '/login' && useUserStore().getToken())
34
37
  next({ path: '/' })
35
38