注册结束之后自动跳转登录界面,带上账号

This commit is contained in:
季圣华
2023-05-26 20:02:20 +08:00
parent c79880f123
commit bea02ebfed
2 changed files with 13 additions and 2 deletions

View File

@@ -20,7 +20,7 @@
type="password" type="password"
@mouseover="initWeixin" @mouseover="initWeixin"
autocomplete="false" autocomplete="false"
placeholder="密码"> placeholder="请输入密码">
<a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/> <a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
</a-input> </a-input>
</a-form-item> </a-form-item>
@@ -120,6 +120,7 @@
} }
}, },
created () { created () {
this.loadInfo()
this.checkScreen() this.checkScreen()
this.currdatetime = new Date().getTime(); this.currdatetime = new Date().getTime();
Vue.ls.remove(ACCESS_TOKEN) Vue.ls.remove(ACCESS_TOKEN)
@@ -129,6 +130,13 @@
methods: { methods: {
...mapActions([ "Login", "Logout" ]), ...mapActions([ "Login", "Logout" ]),
// handler // handler
loadInfo() {
if(this.$route.params.loginName) {
this.$nextTick(() => {
this.form.setFieldsValue({'loginName':this.$route.params.loginName})
})
}
},
handleLoginName (rule, value, callback) { handleLoginName (rule, value, callback) {
const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/; const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
if (regex.test(value)) { if (regex.test(value)) {

View File

@@ -240,7 +240,10 @@
}); });
let that = this; let that = this;
setTimeout(function () { setTimeout(function () {
that.form.resetFields(); that.$router.push({ name: "login", params:{
loginName: register.loginName
}
})
},2000); },2000);
} else { } else {
this.$notification['error']({ this.$notification['error']({