feat(auth): 接入 MEDISIGN 登录接口

- 新增认证 API、类型与本地会话存储
- 登录页改为真实账号密码登录并移除验证码
- 请求拦截器改用 X-Token 并处理 401 跳转
- 添加 Vite /api 开发代理配置
This commit is contained in:
yelan
2026-08-31 10:50:01 +08:00
parent 1e2ff79b0c
commit a5e0a80191
10 changed files with 359 additions and 75 deletions
+10 -3
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { RouterLink, useRouter } from 'vue-router'
import { logout as logoutRequest } from '@/api/auth'
import { useAppStore } from '@/stores/app'
interface MenuItem {
@@ -36,9 +37,15 @@ const menuGroups: MenuGroup[] = [
},
]
function handleLogout() {
appStore.logout()
void router.push('/login')
async function handleLogout() {
try {
await logoutRequest()
} catch {
// 即使服务暂时不可用,也要清理本地会话。
} finally {
appStore.logout()
await router.push('/login')
}
}
</script>