| | |
| | | this.$refs.loginForm.validate((valid) => { |
| | | if (valid) { |
| | | this.loading = true; |
| | | |
| | | if (this.loginForm.rememberMe) { |
| | | Cookies.set("username", this.loginForm.username, { expires: 30 }); |
| | | Cookies.set("password", encrypt(this.loginForm.password), { |
| | |
| | | Cookies.remove("password"); |
| | | Cookies.remove("rememberMe"); |
| | | } |
| | | // this.loginForm.orgid = '1', |
| | | |
| | | // 动态设置 campusid 参数 |
| | | const selectedOrg = this.options.find(item => item.value === this.loginForm.orgid); |
| | | if (selectedOrg) { |
| | | if (selectedOrg.label.includes('湖滨')) { |
| | | this.loginForm.campusid = 1; |
| | | } else if (selectedOrg.label.includes('吴山')) { |
| | | this.loginForm.campusid = 2; |
| | | } else { |
| | | this.loginForm.campusid = 1; // 默认值或其他处理 |
| | | } |
| | | } |
| | | |
| | | this.$store |
| | | .dispatch("Login", this.loginForm) |
| | | .then((res) => { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | } |
| | | }, |
| | | }; |
| | | </script> |