From 5a4778074e90731846e3944a81c4169fbd5f3302 Mon Sep 17 00:00:00 2001 From: RockYang Date: Tue, 12 Aug 2025 07:56:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=AD=A3=E5=9C=A8=E7=99=BB=E5=BD=95=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E9=94=81=E5=AE=9A=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/LoginDialog.vue | 28 +++++++++-- web/src/views/Suno.vue | 2 +- web/src/views/admin/Login.vue | 14 +++++- web/src/views/mobile/Login.vue | 76 ------------------------------ 4 files changed, 36 insertions(+), 84 deletions(-) delete mode 100644 web/src/views/mobile/Login.vue diff --git a/web/src/components/LoginDialog.vue b/web/src/components/LoginDialog.vue index e183895a..4b5d4b7e 100644 --- a/web/src/components/LoginDialog.vue +++ b/web/src/components/LoginDialog.vue @@ -31,8 +31,13 @@ - {{ loading ? '登录中...' : '登 录' }} @@ -193,8 +198,13 @@
- {{ loading ? '注册中...' : '注 册' }}
@@ -287,8 +297,8 @@ const emits = defineEmits(['hide', 'success']) const action = ref('login') const enableVerify = ref(false) const showResetPass = ref(false) -const router = useRouter() const store = useSharedStore() +const loading = ref(false) onMounted(() => { getSystemInfo() @@ -349,6 +359,7 @@ const doLogin = (verifyData) => { data.value.key = verifyData.key data.value.dots = verifyData.dots data.value.x = verifyData.x + loading.value = true httpPost('/api/user/login', data.value) .then((res) => { setUserToken(res.data.token) @@ -360,6 +371,9 @@ const doLogin = (verifyData) => { .catch((e) => { ElMessage.error('登录失败,' + e.message) }) + .finally(() => { + loading.value = false + }) } // 注册操作 @@ -399,6 +413,7 @@ const doRegister = (verifyData) => { data.value.dots = verifyData.dots data.value.x = verifyData.x data.value.reg_way = activeName.value + loading.value = true httpPost('/api/user/register', data.value) .then((res) => { setUserToken(res.data.token) @@ -414,6 +429,9 @@ const doRegister = (verifyData) => { .catch((e) => { ElMessage.error('注册失败,' + e.message) }) + .finally(() => { + loading.value = false + }) } diff --git a/web/src/views/Suno.vue b/web/src/views/Suno.vue index 66fe315d..e24035f2 100644 --- a/web/src/views/Suno.vue +++ b/web/src/views/Suno.vue @@ -566,5 +566,5 @@ onUnmounted(() => { diff --git a/web/src/views/admin/Login.vue b/web/src/views/admin/Login.vue index 7c5f2e70..d4d9692c 100644 --- a/web/src/views/admin/Login.vue +++ b/web/src/views/admin/Login.vue @@ -41,8 +41,13 @@ - {{ loading ? '登录中...' : '登录' }} @@ -73,6 +78,7 @@ const password = ref(import.meta.env.VITE_ADMIN_PASS) const logo = ref('') const enableVerify = ref(false) const captchaRef = ref(null) +const loading = ref(false) checkAdminSession() .then(() => { @@ -106,6 +112,7 @@ const login = function () { } const doLogin = function (verifyData) { + loading.value = true httpPost('/api/admin/login', { username: username.value.trim(), password: password.value.trim(), @@ -120,6 +127,9 @@ const doLogin = function (verifyData) { .catch((e) => { ElMessage.error('登录失败,' + e.message) }) + .finally(() => { + loading.value = false + }) } diff --git a/web/src/views/mobile/Login.vue b/web/src/views/mobile/Login.vue deleted file mode 100644 index acd63d75..00000000 --- a/web/src/views/mobile/Login.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - -