https 替换

This commit is contained in:
2025-12-27 17:34:19 +08:00
parent 55801fa0ec
commit 0fb7a4ffb2
18 changed files with 233 additions and 293 deletions

View File

@@ -225,7 +225,7 @@ const handleUserCommand = (command: string) => {
case 'logout':
localStorage.clear()
ElMessage.success('退出成功')
router.push('/login')
router.push('/platform/login')
break
}
}

View File

@@ -243,7 +243,7 @@ const handleUserCommand = (command: string) => {
case 'logout':
localStorage.clear()
ElMessage.success('退出成功')
router.push('/login')
router.push('/platform/login')
break
}
}

View File

@@ -5,7 +5,7 @@ import { loadRoutesFromStorage } from './dynamicRoute'
// platform应用的动态路由会根据layout字段自动添加不需要预定义Root布局
const routes: RouteRecordRaw[] = [
{
path: '/login',
path: '/platform/login',
name: 'Login',
component: () => import('@/views/public/Login/Login.vue'),
meta: {
@@ -37,13 +37,13 @@ router.beforeEach((to, from, next) => {
if (requiresAuth && !hasToken) {
// 需要登录但未登录,跳转到登录页
next({
path: '/login',
path: '/platform/login',
query: { redirect: to.fullPath } // 保存原始路径
})
return
}
if (to.path === '/login' && hasToken) {
if (to.path === '/platform/login' && hasToken) {
// 已登录但访问登录页,跳转到首页
next('/')
return

View File

@@ -4,6 +4,7 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
import { federation } from '@module-federation/vite'
import { resolve, dirname } from 'path'
import { fileURLToPath } from 'url'
import fs from 'fs'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
@@ -26,7 +27,7 @@ export default defineConfig({
shared: {
type: 'module',
name: 'shared',
entry: 'http://localhost:7000/remoteEntry.js'
entry: 'https://org.xyzh.yslg/shared/remoteEntry.js'
}
},
shared: {
@@ -55,6 +56,11 @@ export default defineConfig({
host: true,
cors: true,
open: '/', // 开发时自动打开到根路径
// HTTPS 配置(使用 mkcert 生成的本地开发证书)
https: {
key: fs.readFileSync('C:/Users/FK05/443/localhost+3-key.pem'),
cert: fs.readFileSync('C:/Users/FK05/443/localhost+3.pem')
},
hmr: {
// 修复 base 路径导致的 WebSocket 连接问题
path: '/@vite/client',