diff --git a/ui/page/auth/callback.html b/ui/page/auth/callback.html index bd2305a..72ef703 100644 --- a/ui/page/auth/callback.html +++ b/ui/page/auth/callback.html @@ -492,7 +492,7 @@ return; } - const data = await $env.$vbase.oauthCallback(provider, code, state); + const data = await $mod.$vbase.oauthCallback(provider, code, state); if (data.access_token || data.token) { // Already bound, login success (token set by vbase) @@ -527,7 +527,7 @@ submitting = true; try { - const data = await $env.$vbase.bindAccount(tempToken, bindForm.username, bindForm.password); + const data = await $mod.$vbase.bindAccount(tempToken, bindForm.username, bindForm.password); $message.success($t('auth.bind_success') || 'Binding successful'); setTimeout(() => $router.push('/'), 1000); @@ -546,7 +546,7 @@ submitting = true; try { - const data = await $env.$vbase.bindRegister(tempToken, regForm.username, regForm.email || undefined); + const data = await $mod.$vbase.bindRegister(tempToken, regForm.username, regForm.email || undefined); $message.success($t('auth.register_success') || 'Registration successful'); setTimeout(() => $router.push('/'), 1000); diff --git a/ui/page/auth/login.html b/ui/page/auth/login.html index f0c5a16..987b28c 100644 --- a/ui/page/auth/login.html +++ b/ui/page/auth/login.html @@ -690,7 +690,7 @@ } try { - await $env.$vbase.request('POST', '/api/verification/send', { + await $mod.$vbase.request('POST', '/api/verification/send', { type: type, target: signInForm.target, purpose: 'login' @@ -729,16 +729,16 @@ } const type = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(signInForm.target) ? 'email' : 'phone'; - const data = await $env.$vbase.request('POST', '/api/auth/login/code', { + const data = await $mod.$vbase.request('POST', '/api/auth/login/code', { type: type, target: signInForm.target, code: signInForm.code }); if (data && data.access_token) { - $env.$vbase.token = data.access_token; - if (data.refresh_token) $env.$vbase.refreshToken = data.refresh_token; - if (data.user) $env.$vbase.user = data.user; + $mod.$vbase.token = data.access_token; + if (data.refresh_token) $mod.$vbase.refreshToken = data.refresh_token; + if (data.user) $mod.$vbase.user = data.user; $message.success($t('auth.login_success')); if (redirect === '/' || redirect.startsWith('http')) { @@ -755,7 +755,7 @@ throw new Error($t('auth.fill_all_fields')); } - const success = await $env.$vbase.login(signInForm.username, signInForm.password); + const success = await $mod.$vbase.login(signInForm.username, signInForm.password); if (success) { $message.success($t('auth.login_success')); @@ -803,7 +803,7 @@ try { // Use vbase.request for consistent API handling - const data = await $env.$vbase.request('POST', '/api/auth/register', { + const data = await $mod.$vbase.request('POST', '/api/auth/register', { username: signUpForm.username, email: signUpForm.email || undefined, phone: signUpForm.phone || undefined, @@ -812,12 +812,12 @@ if (data && data.access_token) { // Auto login after register using vbase setters - $env.$vbase.token = data.access_token; + $mod.$vbase.token = data.access_token; if (data.refresh_token) { - $env.$vbase.refreshToken = data.refresh_token; + $mod.$vbase.refreshToken = data.refresh_token; } if (data.user) { - $env.$vbase.user = data.user; + $mod.$vbase.user = data.user; } $message.success($t('auth.register_success')); diff --git a/ui/page/sys/oauth/providers.html b/ui/page/sys/oauth/providers.html index 9adcce1..080aca8 100644 --- a/ui/page/sys/oauth/providers.html +++ b/ui/page/sys/oauth/providers.html @@ -46,7 +46,7 @@ gap: var(--spacing-md); transition: all 0.2s; } - + .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); @@ -200,7 +200,7 @@ loadProviders = async () => { try { - const res = await $env.$vbase.request('GET', '/api/oauth/providers'); + const res = await $vbase.request('GET', '/api/oauth/providers'); providers = res.items || []; } catch (e) { $message.error(e.message); @@ -220,7 +220,7 @@ openCreateModal = () => { isEdit = false; - formData = { code: "", name: "", client_id: "", client_secret: "", enabled: true }; + formData = {code: "", name: "", client_id: "", client_secret: "", enabled: true}; showModal = true; }; @@ -228,7 +228,7 @@ isEdit = true; try { const detail = await $axios.get(`/api/oauth/providers/${p.code}`); - formData = { ...detail, client_secret: "" }; + formData = {...detail, client_secret: ""}; showModal = true; } catch (e) { $message.error(e.message); @@ -267,4 +267,4 @@ $data.loadProviders(); - \ No newline at end of file + diff --git a/ui/page/user/profile.html b/ui/page/user/profile.html index 67ec18c..645feb9 100644 --- a/ui/page/user/profile.html +++ b/ui/page/user/profile.html @@ -62,7 +62,7 @@ font-weight: bold; overflow: hidden; } - + .avatar img { width: 100%; height: 100%; @@ -156,7 +156,8 @@
Avatar - {{ user.nickname ? user.nickname.charAt(0).toUpperCase() : (user.username ? user.username.charAt(0).toUpperCase() : 'U') }} + {{ user.nickname ? user.nickname.charAt(0).toUpperCase() : (user.username ? + user.username.charAt(0).toUpperCase() : 'U') }}
@@ -167,7 +168,7 @@
{{ $t('common.id') }}: {{ user.id }}
- +
@@ -189,11 +190,14 @@
{{ $t('auth.security') || 'Security' }}
- - + +
- + {{ $t('auth.change_password') || 'Update Password' }}
@@ -220,7 +224,8 @@
- + {{ $t('common.unbind') }} @@ -234,11 +239,11 @@
- \ No newline at end of file +