|
|
@ -53,7 +53,7 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<h1 class="h3 mb-3 font-weight-normal">登录页</h1>
|
|
|
|
<h1 class="h3 mb-3 font-weight-normal">登录页</h1>
|
|
|
|
<el-tabs v-model="activeName">
|
|
|
|
<el-tabs v-model="activeName">
|
|
|
|
<el-tab-pane label="本地认证" name="first">
|
|
|
|
<el-tab-pane label="管理员登陆" name="first">
|
|
|
|
<el-form :model="localAuth" :rules="rules" ref="localAuth">
|
|
|
|
<el-form :model="localAuth" :rules="rules" ref="localAuth">
|
|
|
|
<el-form-item prop="username">
|
|
|
|
<el-form-item prop="username">
|
|
|
|
<el-input v-model="localAuth.username" placeholder="用户名"></el-input>
|
|
|
|
<el-input v-model="localAuth.username" placeholder="用户名"></el-input>
|
|
|
@ -66,35 +66,16 @@
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane label="IMAP认证" name="second">
|
|
|
|
<el-tab-pane label="客服登陆" name="second">
|
|
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm">
|
|
|
|
<el-form :model="kefuForm" :rules="rules" ref="kefuForm">
|
|
|
|
<el-form-item prop="server">
|
|
|
|
<el-form-item prop="username">
|
|
|
|
<el-input v-model="ruleForm.server" placeholder="IMAP服务器如imap.sina.net:143"></el-input>
|
|
|
|
<el-input v-model="kefuForm.username" placeholder="用户名"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item prop="email">
|
|
|
|
|
|
|
|
<el-input v-model="ruleForm.email" placeholder="邮箱地址"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item prop="password">
|
|
|
|
|
|
|
|
<el-input v-model="ruleForm.password" placeholder="密码"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
|
|
|
<el-button :loading="loading" type="primary" @click="submitForm('ruleForm')">IMAP验证</el-button>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
<el-tab-pane label="MYSQL认证" name="third">
|
|
|
|
|
|
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm">
|
|
|
|
|
|
|
|
<el-form-item prop="server">
|
|
|
|
|
|
|
|
<el-input v-model="ruleForm.server" placeholder="MYSQL服务地址"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item prop="email">
|
|
|
|
|
|
|
|
<el-input v-model="ruleForm.email" placeholder="MYSQL用户名"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item prop="password">
|
|
|
|
<el-form-item prop="password">
|
|
|
|
<el-input v-model="ruleForm.password" placeholder="MYSQL密码"></el-input>
|
|
|
|
<el-input v-model="kefuForm.password" placeholder="密码"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button :loading="loading" type="primary" @click="submitForm('ruleForm')">MYSQL验证</el-button>
|
|
|
|
<el-button :loading="loading" type="primary" @click="kefuLogin('kefuForm')">客服登陆</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tab-pane>
|
|
|
@ -128,6 +109,10 @@
|
|
|
|
email:'',
|
|
|
|
email:'',
|
|
|
|
password:'',
|
|
|
|
password:'',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
kefuForm:{
|
|
|
|
|
|
|
|
username:'',
|
|
|
|
|
|
|
|
password:'',
|
|
|
|
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
rules: {
|
|
|
|
server: [
|
|
|
|
server: [
|
|
|
|
{ required: true, message: 'IMAP服务器如"imap.sina.net:143"包含端口号', trigger: 'blur' },
|
|
|
|
{ required: true, message: 'IMAP服务器如"imap.sina.net:143"包含端口号', trigger: 'blur' },
|
|
|
@ -145,33 +130,36 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
//提交表单
|
|
|
|
//提交表单
|
|
|
|
submitForm(formName){
|
|
|
|
kefuLogin(formName){
|
|
|
|
let _this=this;
|
|
|
|
let _this=this;
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
if (valid) {
|
|
|
|
if (!valid) {
|
|
|
|
var data={}
|
|
|
|
return false;
|
|
|
|
data.server=_this.ruleForm.server;
|
|
|
|
} else {
|
|
|
|
data.email=_this.ruleForm.email;
|
|
|
|
let data = {};
|
|
|
|
data.password=_this.ruleForm.password;
|
|
|
|
data.type="kefulogin";
|
|
|
|
_this.loading=true;
|
|
|
|
data.username = _this.kefuForm.username;
|
|
|
|
$.post("/check",data,function(data){
|
|
|
|
data.password = _this.kefuForm.password;
|
|
|
|
if(data.code==200){
|
|
|
|
_this.loading = true;
|
|
|
|
_this.$message({
|
|
|
|
$.post("/check", data, function (data) {
|
|
|
|
message: data.msg,
|
|
|
|
if (data.code == 200) {
|
|
|
|
type: 'success'
|
|
|
|
_this.$message({
|
|
|
|
});
|
|
|
|
message: data.msg,
|
|
|
|
//window.location.href="/";
|
|
|
|
type: 'success'
|
|
|
|
}else{
|
|
|
|
});
|
|
|
|
_this.$message({
|
|
|
|
localStorage.setItem("token",data.result.token);
|
|
|
|
message: data.msg,
|
|
|
|
localStorage.setItem("ref_token",data.result.ref_token);
|
|
|
|
type: 'error'
|
|
|
|
localStorage.setItem("create_time",data.result.create_time);
|
|
|
|
});
|
|
|
|
window.location.href="/main";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
_this.loading=false;
|
|
|
|
_this.$message({
|
|
|
|
});
|
|
|
|
message: data.msg,
|
|
|
|
} else {
|
|
|
|
type: 'error'
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_this.loading = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//重置表单
|
|
|
|
//重置表单
|
|
|
|