需求:
1. 默认访问 /metalinfo 未登录时跳到 CASSIC 风格登录页
2. 登录页支持两种模式: 账号密码登录 / 统一身份登录(CAS)
3. 登录成功跳转 /welcome (原蓝色登录页布局,但右侧表单换成玻璃风"立即体验"按钮)
变更:
- 新增 chat_web_front/src/views/welcome/index.vue
- 复用现有蓝色 Waves + projectLogo + "聚尖端之力" 文案
- 玻璃磨砂按钮(backdrop-filter blur),圆角胶囊 + 圆形箭头
- 点击 → router.push('/chat')
- 重写 chat_web_front/src/views/login/index.vue
- CASSIC 红金背景图(cassicLoginBg.jpg, 1920x1080 by /Users/jayliu/gangyan/ui)
- "登录注册中心" 标题 + 红色短分隔条
- 账号/密码/验证码 三段式表单 (el-icon User/Lock/Stamp)
- "短信验证登录" 链接切换到 SMS 模式
- 主红登录按钮 + 次级"统一身份登录(CASSIC)"白底红边按钮
- 登录成功后 router.push('/welcome')
- CAS 回调 cas_token 处理保留
- chat_web_front/src/router/index.ts:
- / → 默认重定向改为 /welcome (原来到 /chat)
- 新增 /welcome 路由
- 复制 ui/微信图片_20260423163044_262_1531.jpg 到
src/assets/images/login/cassicLoginBg.jpg
未做:
- SMS 验证码后端接口 (loginByTel) 仅留前端倒计时占位
- 图形验证码后端 (showCaptcha 默认关)
- 老素材 loginBg.png 仍由 welcome 页使用,未删
测试:
- 访问 /metalinfo → 未登录跳 /login (CASSIC 红金)
- 账号密码登录 / CAS 登录 → 跳 /welcome
- /welcome 点"立即体验" → /chat
85 lines
1.9 KiB
TypeScript
85 lines
1.9 KiB
TypeScript
import type { App } from 'vue'
|
|
import type { RouteRecordRaw } from 'vue-router'
|
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
import { setupPageGuard } from './permission'
|
|
|
|
const routes: RouteRecordRaw[] = [
|
|
{
|
|
path: '/',
|
|
name: '/',
|
|
redirect: '/welcome'
|
|
},
|
|
{
|
|
path: '/login',
|
|
name: 'Login',
|
|
component: () => import('@/views/login/index.vue'),
|
|
},
|
|
{
|
|
path: '/welcome',
|
|
name: 'Welcome',
|
|
component: () => import('@/views/welcome/index.vue'),
|
|
},
|
|
{
|
|
path: '/chat',
|
|
name: 'Chat',
|
|
component: () => import('@/views/chat/index.vue'),
|
|
},
|
|
{
|
|
path: '/writing',
|
|
name: 'Documents',
|
|
component: () => import('@/views/writing/index.vue'),
|
|
},
|
|
{
|
|
path: '/writing/edit',
|
|
name: 'DocWriting',
|
|
component: () => import('@/views/writing/DocWriting.vue'),
|
|
},
|
|
{
|
|
path: '/knowledgeBase',
|
|
name: 'KnowledgeBase',
|
|
component: () => import('@/views/reading/index.vue'),
|
|
},
|
|
{
|
|
path: '/applications',
|
|
name: 'Application',
|
|
component: () => import('@/views/applications/index.vue'),
|
|
},
|
|
{
|
|
path: '/profile',
|
|
name: 'Profile',
|
|
component: () => import('@/views/profile/index.vue'),
|
|
},
|
|
{
|
|
path: '/userManage',
|
|
name: 'UserManage',
|
|
component: () => import('@/views/userManage/index.vue'),
|
|
},
|
|
{
|
|
path: '/translate',
|
|
name: 'Translate',
|
|
component: () => import('@/views/translate/index.vue'),
|
|
},
|
|
{
|
|
path: '/translate/history',
|
|
name: 'TranslateHistory',
|
|
component: () => import('@/views/translate/history.vue'),
|
|
},
|
|
{
|
|
path: '/translate/result',
|
|
name: 'TranslateResult',
|
|
component: () => import('@/views/translate/result.vue'),
|
|
},
|
|
]
|
|
export const router = createRouter({
|
|
history: createWebHashHistory(),
|
|
routes,
|
|
// scrollBehavior: () => ({ left: 0, top: 0 }),
|
|
})
|
|
|
|
setupPageGuard(router)
|
|
|
|
export async function setupRouter(app: App) {
|
|
app.use(router)
|
|
await router.isReady()
|
|
}
|