瀏覽代碼

Merge branch 'master' of http://git.zthymaoyi.com/gongdecai/wangluohuoyun-htqd

gjy 2 年之前
父節點
當前提交
55ca32d27e
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      src/views/login/index.vue

+ 6 - 5
src/views/login/index.vue

@@ -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({