merge main

This commit is contained in:
pengzhisheng
2025-03-14 05:47:08 +08:00
33 changed files with 605 additions and 521 deletions
+8 -4
View File
@@ -25,7 +25,7 @@
</div>
<div class="input-box">
<img src="@/assets/login/password.png" alt="" class="input-icon"/>
<el-input v-model="form.password" placeholder="请输入密码"/>
<el-input v-model="form.password" type="password" placeholder="请输入密码"/>
</div>
<div style="display: flex; align-items: center; margin-top: 20px; width: 100%; gap: 10px;">
<div class="input-box" style="width: calc(100% - 130px); margin-top: 0;">
@@ -63,7 +63,7 @@
</template>
<script>
import {goToPage, showDanger, showSuccess} from '@/utils'
import {getUUID, goToPage, showDanger, showSuccess} from '@/utils'
import Api from '@/apis/api';
@@ -87,7 +87,7 @@ export default {
},
methods: {
fetchCaptcha() {
this.captchaUuid = Date.now().toString()
this.captchaUuid = getUUID();
Api.user.getCaptcha(this.captchaUuid, (res) => {
if (res.status === 200) {
@@ -96,7 +96,7 @@ export default {
} else {
console.error('验证码加载异常:', error);
showDanger('验证码加载失败,点击刷新');
showDanger('验证码加载失败,点击刷新')
}
});
},
@@ -117,9 +117,13 @@ export default {
this.form.captchaId = this.captchaUuid
Api.user.login(this.form, ({data}) => {
console.log(data)
showSuccess('登陆成功!')
goToPage('/home')
})
setTimeout(() => {
this.fetchCaptcha()
}, 1000)
},
goToRegister() {
+5 -3
View File
@@ -83,7 +83,7 @@
</template>
<script>
import {goToPage, showDanger, showSuccess} from '@/utils'
import {getUUID, goToPage, showDanger, showSuccess} from '@/utils'
import Api from '@/apis/api';
export default {
@@ -106,7 +106,7 @@ export default {
methods: {
// 复用验证码获取方法
fetchCaptcha() {
this.form.captchaId = Date.now().toString()
this.form.captchaId = getUUID();
Api.user.getCaptcha(this.form.captchaId, (res) => {
if (res.status === 200) {
const blob = new Blob([res.data], {type: res.data.type});
@@ -147,7 +147,9 @@ export default {
this.fetchCaptcha()
}
})
setTimeout(() => {
this.fetchCaptcha()
}, 1000)
},
goToLogin() {