[fix][V]:完善登陆逻辑

master
Romesum 5 years ago
parent d0af2873d6
commit d0d37d9e89

@ -17,10 +17,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="账号:" required prop="account"> <el-form-item label="账号:" required prop="account">
<el-input type="text" v-model="ruleForm.account" placeholder="请输入您的账号" prefix-icon="el-icon-user-solid" class="required"></el-input> <el-input type="text" v-model="ruleForm.account" placeholder="请输入您的账号"
prefix-icon="el-icon-user-solid" class="required"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="密码:" required prop="psw"> <el-form-item label="密码:" required prop="psw">
<el-input type="password" v-model="ruleForm.psw" placeholder="请输入您的密码" prefix-icon="el-icon-s-goods"></el-input> <el-input type="password" v-model="ruleForm.psw" placeholder="请输入您的密码"
prefix-icon="el-icon-s-goods"></el-input>
</el-form-item> </el-form-item>
<el-link class="phoneMessage link">手机短信登陆</el-link> <el-link class="phoneMessage link">手机短信登陆</el-link>
<el-link class="forgetPsw link" @click="dialogVisible = true">忘记密码</el-link> <el-link class="forgetPsw link" @click="dialogVisible = true">忘记密码</el-link>
@ -59,17 +61,16 @@
}, },
character: [{ character: [{
label: '超级管理员', label: '超级管理员',
value:'supAdmister' value: '3'
}, },
{ {
label: '管理员', label: '管理员',
value:'admister' value: '2'
}, },
{ {
label: '老师', label: '老师',
value:'teacher' value: '1'
} }
], ],
rules: { rules: {
account: [{ account: [{
@ -87,52 +88,24 @@
dialogVisible: false dialogVisible: false
} }
}, },
mounted() {
console.log('This is login')
},
methods: { methods: {
aaa:function(){ submitForm (formName) {
console.log('aaaa') this.$refs[formName].validate(async (valid) => {
},
submitForm:function(formName) {
this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
console.log(this.ruleForm.identity) await post('lb/user/login', {
console.log(this.ruleForm.account) auth: this.ruleForm.identity,
console.log(this.ruleForm.psw) username: this.ruleForm.account,
get('login',{ password: this.ruleForm.psw
identity: this.ruleForm.identity,
account: this.ruleForm.account,
psw: this.ruleForm.psw
}) })
post('login',{ //
identity: this.ruleForm.identity,
account: this.ruleForm.account,
psw: this.ruleForm.psw
})
// axios.post('/login', {
// identity: this.identity,
// account: this.account,
// psw: this.psw
// })
// .then(function (response) { //
// console.log(response);
// this.$router.push('/')
// })
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;
} }
}); });
}, },
},
async mounted() {
const data = await post('weapp/login',{
code:"123456"
})
console.log(data)
} }
} }
</script> </script>
@ -140,10 +113,12 @@
#demo1 { #demo1 {
background-color: aquamarine; background-color: aquamarine;
} }
#login { #login {
width: 400px; width: 400px;
/*z-index:2*/ /*z-index:2*/
} }
.card { .card {
position: absolute; position: absolute;
top: 25%; top: 25%;
@ -155,6 +130,7 @@
position: relative; position: relative;
left: 28%; left: 28%;
} }
.phoneMessage { .phoneMessage {
position: relative; position: relative;
left: 25%; left: 25%;

Loading…
Cancel
Save