feat: improve authentication and user management

- Fix token missing issue after email code registration/login
- Add last login time update for code-based login
- Support email login in addition to username login
- Fix password login for code-registered users (allow setting password)
- Fix referral code parameter passing from URL hash
- Add email column to user management table
- Improve profile page layout (align card heights, reorganize layout)
- Add i18n support for Register Bonus, Referral Bonus, Code Lock Minutes, Code Max Attempts
- Fix billing service add_credits to support reference_id parameter
- Update password handling documentation
This commit is contained in:
TIANHE
2026-01-14 20:42:10 +08:00
parent fa721c034c
commit 445e7ac290
33 changed files with 7715 additions and 234 deletions
+6 -1
View File
@@ -29,7 +29,12 @@ router.beforeEach((to, from, next) => {
to.meta && typeof to.meta.title !== 'undefined' && setDocumentTitle(`${i18nRender(to.meta.title)} - ${domTitle}`)
// Check whether we have a token (local-only auth).
const token = storage.get(ACCESS_TOKEN)
// 处理 token 可能是字符串或对象的情况
let token = storage.get(ACCESS_TOKEN)
if (token && typeof token !== 'string') {
token = token.token || token.value || (typeof token === 'object' ? null : token)
}
token = typeof token === 'string' ? token : null
if (token) {
// 有 token,允许访问所有页面