Commit 84a098a3 by lijiabin

【需求 17679】fix: 优化部署等

parent 9d944558
...@@ -7,11 +7,11 @@ import path from 'node:path' ...@@ -7,11 +7,11 @@ import path from 'node:path'
const unzipDirMode = { const unzipDirMode = {
spawn: 'pnpm run build:test', spawn: 'pnpm run build:test',
// 解压文件名 // 解压文件名
unzipDir: 'oa-test/', unzipDir: 'culture/',
// 终端定位位置 cd // 终端定位位置 cd
servicePath: '/usr/local/nginx/www/', servicePath: '/usr/local/nginx/',
// 压缩包存放位置 // 压缩包存放位置
serviceFilePath: '/usr/local/nginx/www/dist.tar.gz', serviceFilePath: '/usr/local/nginx/dist.tar.gz',
} }
const __dirname = path.resolve() const __dirname = path.resolve()
// 文件所在地 // 文件所在地
......
<template> <template>
<h1>ccccccccccccccccccccccccccccccccccccccccccccccccccccc1</h1>
<h1>ccccccccccccccccccccccccccccccccccccccccccccccccccccc1</h1>
<h1>ccccccccccccccccccccccccccccccccccccccccccccccccccccc1</h1>
<h1>ccccccccccccccccccccccccccccccccccccccccccccccccccccc1</h1>
<h1>ccccccccccccccccccccccccccccccccccccccccccccccccccccc1</h1>
<h1>ccccccccccccccccccccccccccccccccccccccccccccccccccccc1</h1>
<h1>ccccccccccccccccccccccccccccccccccccccccccccccccccccc1</h1>
<el-config-provider :locale="locale"> <el-config-provider :locale="locale">
<router-view v-slot="{ Component }"> <router-view v-slot="{ Component }">
<component :is="Component" /> <component :is="Component" />
......
...@@ -3,19 +3,19 @@ import type { Router } from 'vue-router' ...@@ -3,19 +3,19 @@ import type { Router } from 'vue-router'
import { saveScrollPosition } from './scrollStorage' import { saveScrollPosition } from './scrollStorage'
import { parseCode, parseIsCodeLogin, parseIsCutEmail } from '@/utils/wxUtil' import { parseCode, parseIsCodeLogin, parseIsCutEmail } from '@/utils/wxUtil'
import { useUserStore } from '@/stores' import { useUserStore } from '@/stores'
import { fa } from 'element-plus/es/locales.mjs'
// 白名单 // 白名单
const WHITE_LIST: string[] = [] const WHITE_LIST: string[] = ['/aa']
export function registerRouterGuard(router: Router) { export function registerRouterGuard(router: Router) {
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from) => {
// 保存当前页面的滚动位置 // 保存当前页面的滚动位置
if (from.fullPath) { if (from.fullPath) {
saveScrollPosition(from.fullPath, window.scrollY) saveScrollPosition(from.fullPath, window.scrollY)
} }
if (WHITE_LIST.includes(to.path)) { if (WHITE_LIST.includes(to.path)) {
next() return true
return
} }
const code = parseCode() const code = parseCode()
...@@ -27,10 +27,11 @@ export function registerRouterGuard(router: Router) { ...@@ -27,10 +27,11 @@ export function registerRouterGuard(router: Router) {
const userStore = useUserStore() const userStore = useUserStore()
if (code) { if (code) {
console.log('code', code)
await userStore.getUserInfoByCode(code) await userStore.getUserInfoByCode(code)
return next() return true
} else { } else {
return next() return true
} }
}) })
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment