|
|
|
@ -9,8 +9,8 @@ |
|
|
|
|
<div class="ms-login"> |
|
|
|
|
<div class="ms-title"> |
|
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick"> |
|
|
|
|
<el-tab-pane label="账号登录" name="first"> |
|
|
|
|
<el-form :model="param" :rules="rules" ref="login" label-width="0px" style="margin-top: 40px"> |
|
|
|
|
<el-tab-pane label="账号登录" name="0"> |
|
|
|
|
<el-form :model="param" :rules="rules" ref="param" label-width="0px" style="margin-top: 40px"> |
|
|
|
|
<el-form-item prop="username"> |
|
|
|
|
<el-input v-model="param.username" placeholder="请输入账号"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
@ -19,13 +19,13 @@ |
|
|
|
|
type="password" |
|
|
|
|
placeholder="请输入密码" |
|
|
|
|
v-model="param.password" |
|
|
|
|
@keyup.enter.native="submitForm()" |
|
|
|
|
@keyup.enter.native="submitForm('param')" |
|
|
|
|
> |
|
|
|
|
</el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-button type="text" class="forget">忘记密码?</el-button> |
|
|
|
|
<!-- <el-button type="text" class="forget">忘记密码?</el-button> --> |
|
|
|
|
<div class="login-btn"> |
|
|
|
|
<el-button type="primary" @click="submitForm()">马上登录</el-button> |
|
|
|
|
<el-button type="primary" @click="submitForm('param')">马上登录</el-button> |
|
|
|
|
</div> |
|
|
|
|
<!-- <p class="login-tips">使用第三方账号直接登录</p> |
|
|
|
|
<p class="thirdParty"> |
|
|
|
@ -35,7 +35,26 @@ |
|
|
|
|
</el-form> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
|
|
|
|
|
<el-tab-pane label="扫描登录" name="second">扫描登录</el-tab-pane> |
|
|
|
|
<el-tab-pane label="手机号/邮箱登录" name="1"> |
|
|
|
|
<el-form :model="phoneParam" :rules="phoneRules" ref="phoneParam" label-width="0px" style="margin-top: 40px"> |
|
|
|
|
<el-form-item prop="userphone"> |
|
|
|
|
<el-input v-model="phoneParam.userphone" placeholder="请输入手机号/邮箱"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="phonePassword"> |
|
|
|
|
<el-input |
|
|
|
|
type="password" |
|
|
|
|
placeholder="请输入密码" |
|
|
|
|
v-model="phoneParam.phonePassword" |
|
|
|
|
@keyup.enter.native="submitForm('phoneParam')" |
|
|
|
|
> |
|
|
|
|
</el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<!-- <el-button type="text" class="forget">忘记密码?</el-button> --> |
|
|
|
|
<div class="login-btn"> |
|
|
|
|
<el-button type="primary" @click="submitForm('phoneParam')">马上登录</el-button> |
|
|
|
|
</div> |
|
|
|
|
</el-form> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -48,23 +67,32 @@ export default { |
|
|
|
|
data: function() { |
|
|
|
|
return { |
|
|
|
|
param: { |
|
|
|
|
username: '', |
|
|
|
|
password: '', |
|
|
|
|
username: 'admin', |
|
|
|
|
password: 'admin' |
|
|
|
|
}, |
|
|
|
|
rules: { |
|
|
|
|
username: [{ required: true, message: '请输入账号', trigger: 'blur' }], |
|
|
|
|
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], |
|
|
|
|
password: [{ required: true, message: '请输入密码', trigger: 'blur' }], |
|
|
|
|
}, |
|
|
|
|
activeName: 'first' |
|
|
|
|
phoneParam: { |
|
|
|
|
userphone: '', |
|
|
|
|
phonePassword: '' |
|
|
|
|
}, |
|
|
|
|
phoneRules: { |
|
|
|
|
userphone: [{ required: true, message: '请输入手机号/邮箱', trigger: 'blur' }], |
|
|
|
|
phonePassword: [{ required: true, message: '请输入密码', trigger: 'blur' }], |
|
|
|
|
}, |
|
|
|
|
activeName: '0' |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
submitForm() { |
|
|
|
|
this.$refs.login.validate(valid => { |
|
|
|
|
submitForm(form) { |
|
|
|
|
this.$refs[form].validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
let data = { |
|
|
|
|
account: this.param.username, |
|
|
|
|
password: this.param.password |
|
|
|
|
account: this.activeName == '0' ? this.param.username : this.phoneParam.userphone, |
|
|
|
|
password: this.activeName == '0' ? this.param.password : this.phoneParam.phonePassword, |
|
|
|
|
source: this.activeName |
|
|
|
|
} |
|
|
|
|
this.$get(this.api.logins,data).then(res => { |
|
|
|
|
let data = res.message.retvalue |
|
|
|
@ -82,6 +110,9 @@ export default { |
|
|
|
|
// this.$message.error('该用户没有权限'); |
|
|
|
|
// } |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
} else { |
|
|
|
|
this.$message.error('请输入账号和密码'); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|