| | |
| | | password: "", |
| | | rememberMe: false, |
| | | code: "", |
| | | orgid: "47255004333112711A1001", |
| | | orgid: "H41010500003", |
| | | }, |
| | | options: [ |
| | | { value: "47255004333112711A1001", label: "景宁畲族自治县人民医院" }, |
| | | { value: "47231022633110211A2101", label: "丽水市中医院" }, |
| | | { value: "47246102433112211A2101", label: "缙云县中医医院 " }, |
| | | { value: "47240018433118111A2101", label: "龙泉市中医医院 " }, |
| | | { value: "47240004533118111A1001", label: "龙泉市人民医院 " }, |
| | | { value: "47243006833112611A2101", label: "庆元县中医医院 " }, |
| | | { value: "47234002X33112111A2101", label: "青田县中医医院 " }, |
| | | ], |
| | | options: [], |
| | | loginRules: { |
| | | username: [ |
| | | { required: true, trigger: "blur", message: "请输入您的账号" }, |
| | |
| | | }); |
| | | }, |
| | | getorganization() { |
| | | getorganization().then((res) => { |
| | | getorganization({ pageSize: 30 }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.options = res.rows.map((item) => ({ |
| | | value: item.orgid, |
| | |
| | | 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) => { |