|
|
@ -10,18 +10,21 @@
|
|
|
|
<div class="lgf-outter">
|
|
|
|
<div class="lgf-outter">
|
|
|
|
<a-form-model layout="horizontal" :model="form" :rules="rules" ref="loginForm">
|
|
|
|
<a-form-model layout="horizontal" :model="form" :rules="rules" ref="loginForm">
|
|
|
|
<a-form-model-item label="用户名" prop="sUserName">
|
|
|
|
<a-form-model-item label="用户名" prop="sUserName">
|
|
|
|
<a-input v-model="form.sUserName" placeholder="请输入账号" autocomplete="off" :maxLength="30"/>
|
|
|
|
<a-input v-model="form.sUserName" placeholder="请输入账号" autocomplete="off" :maxLength="30" />
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-form-model-item>
|
|
|
|
<a-form-model-item label="密码" prop="sPwd">
|
|
|
|
<a-form-model-item label="密码" prop="sPwd">
|
|
|
|
<a-input v-model="form.sPwd" :type="pwdType" placeholder="请输入密码" autocomplete="off">
|
|
|
|
<a-input v-model="form.sPwd" :type="pwdType" placeholder="请输入密码" autocomplete="off">
|
|
|
|
<span slot="suffix" class="iconfont icon-zhengyan-21 login-eye" v-if="pwdType==='password'" @click="changePwdType"></span>
|
|
|
|
<span slot="suffix" class="iconfont icon-zhengyan-21 login-eye" v-if="pwdType === 'password'"
|
|
|
|
|
|
|
|
@click="changePwdType"></span>
|
|
|
|
<span slot="suffix" class="iconfont icon-in_biyan login-eye" v-else @click="changePwdType"></span>
|
|
|
|
<span slot="suffix" class="iconfont icon-in_biyan login-eye" v-else @click="changePwdType"></span>
|
|
|
|
</a-input>
|
|
|
|
</a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-form-model-item>
|
|
|
|
<a-form-model-item label="验证码" prop="sVerifycode">
|
|
|
|
<a-form-model-item label="验证码" prop="sVerifycode">
|
|
|
|
<a-input v-model="form.sVerifycode" placeholder="请输入验证码" autocomplete="off">
|
|
|
|
<a-input v-model="form.sVerifycode" placeholder="请输入验证码" autocomplete="off">
|
|
|
|
<a-button slot="addonAfter" style="width: 100px" @click="getCode" v-if="!codeImg" :loading="btnLoading">获取验证码</a-button>
|
|
|
|
<a-button slot="addonAfter" style="width: 100px" @click="getCode" v-if="!codeImg"
|
|
|
|
<img style="width: 6rem; height: 2rem;cursor: pointer;" slot="addonAfter" :src="codeImg" @click="getCode" v-else>
|
|
|
|
:loading="btnLoading">获取验证码</a-button>
|
|
|
|
|
|
|
|
<img style="width: 6rem; height: 2rem;cursor: pointer;" slot="addonAfter" :src="codeImg"
|
|
|
|
|
|
|
|
@click="getCode" v-else>
|
|
|
|
</a-input>
|
|
|
|
</a-input>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-form-model-item>
|
|
|
|
</a-form-model>
|
|
|
|
</a-form-model>
|
|
|
@ -38,7 +41,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import {loginSubmit, getVerifycode} from "@/api/login"
|
|
|
|
import { loginSubmit, getVerifycode } from "@/api/login"
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "loginForm",
|
|
|
|
name: "loginForm",
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
@ -89,12 +92,12 @@ export default {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
if(JSON.stringify(this.getAccount) != "{}") {
|
|
|
|
if (JSON.stringify(this.getAccount) != "{}") {
|
|
|
|
this.remCheck = this.getAccount.remCheck;
|
|
|
|
this.remCheck = this.getAccount.remCheck;
|
|
|
|
this.form.sUserName = this.getAccount.sUserName;
|
|
|
|
this.form.sUserName = this.getAccount.sUserName;
|
|
|
|
this.form.sPwd = this.getAccount.sPwd;
|
|
|
|
this.form.sPwd = this.getAccount.sPwd;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
// 改变是否可以看密码
|
|
|
|
// 改变是否可以看密码
|
|
|
@ -109,7 +112,7 @@ export default {
|
|
|
|
this.btnLoading = false;
|
|
|
|
this.btnLoading = false;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//忘记密码
|
|
|
|
//忘记密码
|
|
|
|
forgetPassword() {
|
|
|
|
forgetPassword() {
|
|
|
|
this.$emit("forgetPassword");
|
|
|
|
this.$emit("forgetPassword");
|
|
|
@ -118,33 +121,33 @@ export default {
|
|
|
|
onSubmit() {
|
|
|
|
onSubmit() {
|
|
|
|
this.$refs.loginForm.validate((valid) => {
|
|
|
|
this.$refs.loginForm.validate((valid) => {
|
|
|
|
if (valid) {
|
|
|
|
if (valid) {
|
|
|
|
loginSubmit(this.form).then(res => {
|
|
|
|
loginSubmit(this.form).then(res => {
|
|
|
|
let data = res.data;
|
|
|
|
let data = res.data;
|
|
|
|
this.setToken(data.toKen);
|
|
|
|
this.setToken(data.toKen);
|
|
|
|
this.setUser(data);
|
|
|
|
this.setUser(data);
|
|
|
|
this.setLevelBtn(data.levelBtn);
|
|
|
|
this.setLevelBtn(data.levelBtn);
|
|
|
|
//手动添加
|
|
|
|
//手动添加
|
|
|
|
let obj = {
|
|
|
|
let obj = {
|
|
|
|
link:'/saleRank',
|
|
|
|
link: '/saleRank',
|
|
|
|
text:'销量排行'
|
|
|
|
text: '销量排行'
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let obj2 = {
|
|
|
|
let obj2 = {
|
|
|
|
link:'/specialAnalize',
|
|
|
|
link: '/specialAnalize',
|
|
|
|
text:'专项分析'
|
|
|
|
text: '专项分析'
|
|
|
|
};
|
|
|
|
};
|
|
|
|
data.meun.push(obj);
|
|
|
|
data.meun.push(obj);
|
|
|
|
data.meun.push(obj2);
|
|
|
|
data.meun.push(obj2);
|
|
|
|
////
|
|
|
|
////
|
|
|
|
this.setMenu(data.meun);
|
|
|
|
this.setMenu(data.meun);
|
|
|
|
if(this.remCheck) {
|
|
|
|
if (this.remCheck) {
|
|
|
|
this.setAccount({sUserName:this.form.sUserName, sPwd: this.form.sPwd, remCheck: this.remCheck})
|
|
|
|
this.setAccount({ sUserName: this.form.sUserName, sPwd: this.form.sPwd, remCheck: this.remCheck })
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.setAccount({});
|
|
|
|
this.setAccount({});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.$router.push({path: '/'})
|
|
|
|
this.$router.push({ path: '/' })
|
|
|
|
}).catch(() => {
|
|
|
|
}).catch(() => {
|
|
|
|
console.log("登录失败")
|
|
|
|
console.log("登录失败")
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
console.log("error submit!!");
|
|
|
|
console.log("error submit!!");
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -160,20 +163,24 @@ export default {
|
|
|
|
margin: 0 auto;
|
|
|
|
margin: 0 auto;
|
|
|
|
margin-top: 80px;
|
|
|
|
margin-top: 80px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.login-eye {
|
|
|
|
.login-eye {
|
|
|
|
font-size: 16px;
|
|
|
|
font-size: 16px;
|
|
|
|
color: #3373cc;
|
|
|
|
color: #3373cc;
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.login-d1 {
|
|
|
|
.login-d1 {
|
|
|
|
width: 380px;
|
|
|
|
width: 380px;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
justify-content: space-between;
|
|
|
|
margin: 0 auto;
|
|
|
|
margin: 0 auto;
|
|
|
|
|
|
|
|
|
|
|
|
.stn {
|
|
|
|
.stn {
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.login-footer {
|
|
|
|
.login-footer {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
width: 354px;
|
|
|
|
width: 354px;
|
|
|
|