From b18fc26a095ca2855d71b59975dab70d72501451 Mon Sep 17 00:00:00 2001
From: XiGuaSSR <623844246@qq.com>
Date: Mon, 14 Nov 2022 19:35:48 +0800
Subject: [PATCH] 新增国际化
---
src/page/login/login.vue | 39 +++++++++++++++++++--------------------
1 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/src/page/login/login.vue b/src/page/login/login.vue
index e2e12da..c85bd5b 100644
--- a/src/page/login/login.vue
+++ b/src/page/login/login.vue
@@ -18,7 +18,7 @@
<div class="password">
<input type="password" placeholder="登录密码" v-model="userPassword" @input="handleInput()" />
</div> -->
- <el-input placeholder="请输入手机号" :size="medium" v-model="userName" clearable>
+ <el-input placeholder="请输入手机号" :size="medium" maxlength="11" v-model="userName" clearable>
</el-input>
<el-input style="margin-top: 0.46rem;" show-password placeholder="登录密码" :size="medium" v-model="userPassword" @input="handleInput()">
</el-input>
@@ -53,7 +53,7 @@
v-show="alertShow"
:closable="closable"
:title="texts"
- type="warning" center></el-alert>
+ :type="eltype" center></el-alert>
</div>
</template>
<script>
@@ -76,6 +76,7 @@
medium: "medium",
alertShow:false,
closable:false,
+ eltype:'warning',
texts:"",
dengl:false,
loginBtn:false,
@@ -120,11 +121,19 @@
if (data.status === 0) {
this.$store.state.userInfo.phone = this.userName
this.$store.state.userInfo.token = data.data.token
-
+ this.texts=data.msg
+ this.eltype='success'
+ this.alertShow=true
+ setTimeout(()=>{
+ this.alertShow=false
+ this.eltype='warning'
+ this.$router.push('/home')
+ },1000)
+ this.loginBtn = false;
window.localStorage.clear()
window.localStorage.setItem("USERTOKEN", data.data.token);
- this.$router.push('/home')
- this.loginBtn = false;
+
+
} else {
this.texts=data.msg
this.alertShow=true
@@ -134,7 +143,10 @@
},2000)
//Toast(data.msg)
}
-
+ if (navigator.vibrate) {
+ // 支持
+ navigator.vibrate([55]);
+ }
},
},
beforeDestroy() { },
@@ -336,20 +348,7 @@
}
}
}
-/deep/.el-alert{
- width: 70%!important;
- height: 1rem!important;
- position: absolute!important;
- top: 0!important;
- bottom: 0!important;
- left: 0!important;
- right: 0!important;
- margin: auto!important;
- font-size: 0.3rem!important;
-}
-/deep/.el-alert__title{
- font-size: 0.3rem!important;
-}
+
/deep/.el-input__suffix{
width: 1rem!important;
display: flex;
--
Gitblit v1.9.3