优化部分样式问题,新增部分功能,解决发现的bug,暂未完全测试通过。

This commit is contained in:
lemon橪
2021-06-10 18:31:54 +08:00
parent 8b3d19625f
commit c9ea7ba898
30 changed files with 1143 additions and 1131 deletions

View File

@@ -23,12 +23,7 @@
</Row>
<!-- 拼图验证码 -->
<verify
ref="verify"
class="verify-con"
verifyType="LOGIN"
@change="verifyChange"
></verify>
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
<div v-if="socialLogining">
<RectLoading />
</div>
@@ -48,7 +43,7 @@ import LangSwitch from "@/views/main-components/lang-switch";
import RectLoading from "@/views/my-components/lili/rect-loading";
import CountDownButton from "@/views/my-components/lili/count-down-button";
import util from "@/libs/util.js";
import verify from '@/views/my-components/verify';
import verify from "@/views/my-components/verify";
export default {
components: {
@@ -57,18 +52,20 @@ export default {
LangSwitch,
Header,
Footer,
verify
verify,
},
data() {
return {
loading: false, // 加载状态
form: { // 表单数据
form: {
// 表单数据
username: "",
password: "",
mobile: "",
code: "",
},
rules: { // 验证规则
rules: {
// 验证规则
username: [
{
required: true,
@@ -88,7 +85,8 @@ export default {
},
methods: {
mounted() {},
afterLogin(res) { // 登录成功后处理
afterLogin(res) {
// 登录成功后处理
let accessToken = res.result.accessToken;
let refreshToken = res.result.refreshToken;
this.setStore("accessToken", accessToken);
@@ -109,28 +107,35 @@ export default {
}
});
},
submitLogin() { // 登录操作
submitLogin() {
// 登录操作
this.$refs.usernameLoginForm.validate((valid) => {
if (valid) {
this.$refs.verify.show = true;
}
});
},
verifyChange (con) { // 拼图验证码回显
verifyChange(con) {
// 拼图验证码回显
if (!con.status) return;
this.loading = true;
login({
username: this.form.username,
password: this.md5(this.form.password),
}).then((res) => {
if (res && res.success) {
this.afterLogin(res);
} else {
})
.then((res) => {
if (res && res.success) {
this.afterLogin(res);
} else {
this.loading = false;
}
})
.catch(() => {
this.loading = false;
}
}).catch(()=>{this.loading = false});
}
});
this.$refs.verify.show = false;
},
},
};
</script>
@@ -154,7 +159,7 @@ export default {
position: relative;
zoom: 1;
}
.verify-con{
.verify-con {
position: absolute;
top: 90px;
z-index: 10;
@@ -198,5 +203,4 @@ export default {
.flex {
justify-content: center;
}
</style>