fix(auth): fix regex in JWT decoding causing login issues for Chinese/Japanese user names (#809)

This commit is contained in:
Weijie Zhao
2025-05-21 18:20:11 +08:00
committed by GitHub
parent c4566fdb53
commit 33e78c35da

View File

@@ -284,8 +284,8 @@ export const useAuthStore = defineStore('auth', () => {
try {
const base64 = jwt
.split('.')[1]
.replace('/-/g', '+')
.replace('/_/g', '/')
.replace(/-/g, '+')
.replace(/_/g, '/')
const info = new UserModel(JSON.parse(atob(base64)))
const ts = Math.round((new Date()).getTime() / MILLISECONDS_A_SECOND)