|
@@ -274,19 +274,21 @@
|
|
|
});
|
|
|
},
|
|
|
handleLogin() {
|
|
|
+ let that = this
|
|
|
this.$refs.loginForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.loginForm.companyName = "黑龙江中天昊元贸易有限公司";
|
|
|
this.loading = true;
|
|
|
// this.$store.dispatch('user/login', this.loginForm)
|
|
|
// const res = await this.$store.dispatch('user/login', this.loginForm)、
|
|
|
- getlogin({
|
|
|
+ const res = await getlogin({
|
|
|
loginName: this.loginForm.username,
|
|
|
loginPassword: this.loginForm.password,
|
|
|
compId: "2710b21efc1e4393930c5dc800010dc4",
|
|
|
- }).then(response => { //校验错误次数(五次锁定)
|
|
|
- if (response.code == 200) {
|
|
|
- this.login(this.loginForm);
|
|
|
+ })
|
|
|
+
|
|
|
+ if (res.code == 200) {
|
|
|
+ const res = await this.$store.dispatch('user/login', this.loginForm)
|
|
|
localStorage.setItem("ws_login_type", 2);
|
|
|
Cookies.set("ws_login_companyShortName", this.loginForm.companyName, {
|
|
|
expires: 365,
|
|
@@ -318,7 +320,6 @@
|
|
|
} else {
|
|
|
this.$message.error(response.message)
|
|
|
}
|
|
|
- })
|
|
|
// .then(response => {
|
|
|
// localStorage.setItem('UserInfo', JSON.stringify(response.data))
|
|
|
// this.$router.push({
|