feat: Bearer Token 认证,修复 Web 管理后台 401 问题
- HmacAuthInterceptor 增加 Bearer Token 优先认证(Web 管理后台) - AuthController.login 使用 hmac.secret 签发 24h 有效 token - AccountDTO 新增 token 字段(@JsonInclude NON_NULL) - 前端 Login.vue 存储登录返回的 token - 原有 HMAC 签名认证不受影响(外部 API 客户端继续可用)
This commit is contained in:
@@ -40,7 +40,7 @@ const handleLogin = async () => {
|
||||
try {
|
||||
const res = await api.auth.login({ email: form.email, password: form.password })
|
||||
if (res.code === 200) {
|
||||
localStorage.setItem('par_token', res.data.email)
|
||||
localStorage.setItem('par_token', res.data.token || res.data.email)
|
||||
ElMessage.success('登录成功')
|
||||
router.push('/')
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user