|
|
|
@ -6,7 +6,7 @@
|
|
|
|
|
<h2>登录</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<el-form ref="ruleForm" :rules="rules" :model="ruleForm" label-position="left" label-width="70px">
|
|
|
|
|
<el-form-item label="身份:" align="left" prop="name" style="width: 100%">
|
|
|
|
|
<el-form-item label="身份:" align="left" prop="identity" style="width: 100%">
|
|
|
|
|
<el-select v-model="ruleForm.identity" placeholder="请选择您的身份" style="width:100% ">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in character"
|
|
|
|
@ -16,14 +16,16 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="账号:" required prop="username">
|
|
|
|
|
<el-input type="text" v-model="ruleForm.username" placeholder="请输入您的账号" prefix-icon="el-icon-user-solid" class="required"></el-input>
|
|
|
|
|
<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-form-item>
|
|
|
|
|
<el-form-item label="密码:" required prop="password">
|
|
|
|
|
<el-input type="password" v-model="ruleForm.password" placeholder="请输入您的密码" prefix-icon="el-icon-s-goods"></el-input>
|
|
|
|
|
<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-form-item>
|
|
|
|
|
<el-link class="phoneMessage link">手机短信登陆</el-link>
|
|
|
|
|
<el-link class="forgetpassword link" @click="dialogVisible = true">忘记密码</el-link>
|
|
|
|
|
<el-link class="forgetPsw link" @click="dialogVisible = true">忘记密码</el-link>
|
|
|
|
|
<el-divider></el-divider>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-button type="primary" @click="submitForm('ruleForm')" style="width: 100%">登录</el-button>
|
|
|
|
@ -31,7 +33,7 @@
|
|
|
|
|
</el-card>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="forgetpassword">
|
|
|
|
|
<div id="forgetPsw">
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="提示"
|
|
|
|
|
:visible.sync="dialogVisible"
|
|
|
|
@ -54,28 +56,27 @@
|
|
|
|
|
return {
|
|
|
|
|
ruleForm: {
|
|
|
|
|
identity: '',
|
|
|
|
|
username:'',
|
|
|
|
|
password:'',
|
|
|
|
|
account: '',
|
|
|
|
|
psw: '',
|
|
|
|
|
},
|
|
|
|
|
character: [{
|
|
|
|
|
label: '超级管理员',
|
|
|
|
|
value:'supAdmister'
|
|
|
|
|
value: '3'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '管理员',
|
|
|
|
|
value:'admister'
|
|
|
|
|
value: '2'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '老师',
|
|
|
|
|
value:'teacher'
|
|
|
|
|
value: '1'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
rules: {
|
|
|
|
|
username: [{
|
|
|
|
|
account: [{
|
|
|
|
|
required: true, message: '请输入您的账号', trigger: 'blur'
|
|
|
|
|
}],
|
|
|
|
|
password:[
|
|
|
|
|
psw: [
|
|
|
|
|
{
|
|
|
|
|
required: true, message: '请输入您的密码', trigger: 'blur'
|
|
|
|
|
}
|
|
|
|
@ -87,35 +88,24 @@
|
|
|
|
|
dialogVisible: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
console.log('This is login')
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
aaa:function(){
|
|
|
|
|
console.log('aaaa')
|
|
|
|
|
},
|
|
|
|
|
submitForm:function(formName) {
|
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
|
submitForm (formName) {
|
|
|
|
|
this.$refs[formName].validate(async (valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
post('login',{
|
|
|
|
|
identity: this.ruleForm.identity,
|
|
|
|
|
username: this.ruleForm.username,
|
|
|
|
|
password: this.ruleForm.password
|
|
|
|
|
await post('lb/user/login', {
|
|
|
|
|
auth: this.ruleForm.identity,
|
|
|
|
|
username: this.ruleForm.account,
|
|
|
|
|
password: this.ruleForm.psw
|
|
|
|
|
})
|
|
|
|
|
// 跳转页面
|
|
|
|
|
await this.$router.push('/teacher')
|
|
|
|
|
} else {
|
|
|
|
|
console.log('error submit!!');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
async mounted() {
|
|
|
|
|
const data = await post('weapp/login',{
|
|
|
|
|
code:"123456"
|
|
|
|
|
})
|
|
|
|
|
console.log(data)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
@ -123,10 +113,12 @@
|
|
|
|
|
#demo1 {
|
|
|
|
|
background-color: aquamarine;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#login {
|
|
|
|
|
width: 400px;
|
|
|
|
|
/*z-index:2*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 25%;
|
|
|
|
@ -134,10 +126,11 @@
|
|
|
|
|
width: 30%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.forgetpassword{
|
|
|
|
|
.forgetPsw {
|
|
|
|
|
position: relative;
|
|
|
|
|
left: 28%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.phoneMessage {
|
|
|
|
|
position: relative;
|
|
|
|
|
left: 25%;
|
|
|
|
|