闫增涛
2025-01-23 090730ca33bf276f647a1b517eeaf60ffe9f4d0b
src/main.ts
@@ -10,6 +10,13 @@
import toolClass from '@/assets/js/toolClass'
import MG from '@/assets/js/middleGround/WebMiddleGroundApi.js'
import './child.ts'
import { loginCtx } from '@/assets/js/config.ts'
// 公式输入
import { MathfieldElement } from "mathlive"
// 公式解析
import VueLatex from 'vatex'
const handleGetToken = () => {
  return localStorage.getItem('token')
@@ -17,6 +24,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()) {
  //   // 是否是登录页面,直接到首页
@@ -66,8 +80,10 @@
const app = createApp(App)
app.provide('toolClass', toolClass)
app.provide('MG', MG)
app.use(VueLatex)
app.use(router)
app.use(ElementPlus)
app.use(pinia)