Commit 889d78bb authored by chenqikuai's avatar chenqikuai

fix(src\views\auth\login\login.vue): 修复登录时的错误提示

parent 2b7bc75c
<template>
<nav-bar :bangsBlock="true"/>
<nav-bar :bangsBlock="true" />
<div class="register pt-5">
<Icon name="icon-a-shanchu1" color="black" size="20" class="mb-7" @click="handleClickClose" />
<Icon
name="icon-a-shanchu1"
color="black"
size="20"
class="mb-7"
@click="handleClickClose"
/>
<div class="flex justify-between items-center text-base">
<img src="@/assets/icons/app-icon.png" class="h-12" />
</div>
......@@ -45,7 +51,8 @@
:checked="rememberPwdChecked"
@change="handleRememberPwdChange"
class="text-font-gray text-sm"
>记住密码</Check>
>记住密码</Check
>
</div>
<!-- <div class="text-font-gray text-sm" @click="handleClickForgetPwd">
忘记密码
......@@ -62,12 +69,21 @@
:src="checkStatus ? checkedIcon : notCheckedIcon"
/>
</transition>
<span class="text-white" style="color: #474747 !important">我已阅读并同意</span>
<span class="text-white" style="color: #474747 !important"
>我已阅读并同意</span
>
</div>
<div
class="underline text-app-blue"
@click="$router.push({ name: 'UserAgreement' })"
>
用户协议
</div>
<div class="underline text-app-blue" @click="$router.push({ name: 'UserAgreement' })">用户协议</div>
</div>
<transition name="fade" mode="out-in">
<div v-if="accountType !== eAccountType.NULL && loginWay !== eLoginWay.NULL">
<div
v-if="accountType !== eAccountType.NULL && loginWay !== eLoginWay.NULL"
>
<div>
<div v-if="accountType === eAccountType.NO_REG">
<LoginButton
......@@ -89,12 +105,16 @@
v-if="loginWay === eLoginWay.PWD"
@click="transferLoginWay(eLoginWay.CODE)"
class="text-center text-app-blue"
>验证码登录</div>
>
验证码登录
</div>
<div
class="text-center text-app-blue"
v-if="loginWay === eLoginWay.CODE"
@click="transferLoginWay(eLoginWay.PWD)"
>密码登录</div>
>
密码登录
</div>
</div>
</div>
</div>
......@@ -103,7 +123,7 @@
</div>
</template>
<script lang='ts'>
<script lang="ts">
import Input from "@/components/common/Input/index.vue";
import CodeInput from "./components/CodeInput/index.vue";
import { Dialog, Toast } from "vant";
......@@ -124,13 +144,13 @@ import LoginButton from "./components/LoginButton/index.vue";
import Check from "@/components/common/Check/index.vue";
import PhoneInput from "./components/PhoneInput/index.vue";
import SlideValidator from "@/components/common/SlideValidator/index.vue";
import Icon from "@/components/common/Icon.vue"
import Icon from "@/components/common/Icon.vue";
import notCheckedIcon from "@/assets/icons/not_checked.png";
import checkedIcon from "@/assets/icons/checked.png";
import LoginSerivce from "./LoginService";
import NavBar from "@/components/NavBar/index.vue"
import NavBar from "@/components/NavBar/index.vue";
const accountType = eAccountType.NULL;
const loginWay = eLoginWay.NULL;
......@@ -173,7 +193,7 @@ export default defineComponent({
Check,
PhoneInput,
SlideValidator,
Icon
Icon,
},
data() {
return {
......@@ -201,7 +221,7 @@ export default defineComponent({
this.$router.go(-1);
},
handleClear(phone: string) {
this.pwd = '';
this.pwd = "";
},
handleSelect(item: iRememberPhonePwd) {
this.ignorePhoneCheck = true;
......@@ -209,10 +229,10 @@ export default defineComponent({
this.pwd = item.pwd;
this.rememberPwdChecked = true;
this.loginWay = eLoginWay.PWD;
this.accountType = eAccountType.REG_PDSET
this.accountType = eAccountType.REG_PDSET;
this.$nextTick(() => {
this.ignorePhoneCheck = true;
})
});
},
handleClickRadio() {
this.checkStatus = !this.checkStatus;
......@@ -239,7 +259,7 @@ export default defineComponent({
try {
await this.registerFunc(phone, code);
} catch (err: any) {
Toast.fail(err)
Toast.fail(err.message);
}
this.loading = false;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment