litian
2024-08-22 39a97e8e27d52ca0729cb6b0294a37717d063d0a
src/main.ts
@@ -10,6 +10,7 @@
import toolClass from '@/assets/js/toolClass'
import MG from '@/assets/js/middleGround/WebMiddleGroundApi.js'
import './child.ts'
import { loginCtx } from '@/assets/js/config.ts'
const handleGetToken = () => {
  return localStorage.getItem('token')
@@ -17,6 +18,13 @@
// 路由执行之前的一些操作
router.beforeEach((to, from, next) => {
  const isInternalLink = from.fullPath.includes('/testBookReader')
  if (isInternalLink) {
    sessionStorage.removeItem('loginCtx')
  } else {
    sessionStorage.setItem('loginCtx', loginCtx)
  }
  next()
  // if (handleGetToken()) {
  //   // 是否是登录页面,直接到首页