| | |
| | | }, |
| | | // è´¦å·å¯ç ç»å½ |
| | | submitForm(formName) { |
| | | this.$router.push("/index"); |
| | | // this.$refs[formName].validate((valid) => { |
| | | // if (valid) { |
| | | // const loading = this.$loading({ |
| | | // lock: true, |
| | | // text: "Loading", |
| | | // spinner: "el-icon-loading", |
| | | // background: "rgba(0, 0, 0, 0.7)", |
| | | // }); |
| | | // this.$router.push("/index"); |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | const loading = this.$loading({ |
| | | lock: true, |
| | | text: "Loading", |
| | | spinner: "el-icon-loading", |
| | | background: "rgba(0, 0, 0, 0.7)", |
| | | }); |
| | | |
| | | // login({ |
| | | // username: this.loginForm.loginname, |
| | | // password: this.loginForm.password, |
| | | // }) |
| | | // .then((res) => { |
| | | // loading.close(); |
| | | // if (res.code !== 200) { |
| | | // this.$message.error(res.msg); |
| | | // } else { |
| | | // let tokenData = res.token; |
| | | // let times = new Date().getTime(); |
| | | // window.localStorage.setItem("TokenTime", times); |
| | | // window.localStorage.setItem("TokenKey", tokenData); |
| | | // this.$router.push("/index"); |
| | | // } |
| | | // }) |
| | | // .catch((error) => { |
| | | // //ç½ç»è¶
æ¶å¼å¸¸å¤ç |
| | | // loading.close(); |
| | | // if ( |
| | | // error.code === "ECONNABORTED" || |
| | | // error.message === "Network Error" || |
| | | // error.message.includes("timeout") |
| | | // ) { |
| | | // this.$message.error("请æ±è¶
æ¶ï¼è¯·ç¨åéè¯"); |
| | | // } |
| | | // return Promise.resolve(error.response); |
| | | // // reject(error); |
| | | // }); |
| | | login({ |
| | | username: this.loginForm.loginname, |
| | | password: this.loginForm.password, |
| | | }) |
| | | .then((res) => { |
| | | loading.close(); |
| | | if (res.code !== 200) { |
| | | this.$message.error(res.msg); |
| | | } else { |
| | | let tokenData = res.token; |
| | | let times = new Date().getTime(); |
| | | window.localStorage.setItem("TokenTime", times); |
| | | window.localStorage.setItem("TokenKey", tokenData); |
| | | this.$router.push("/index"); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | //ç½ç»è¶
æ¶å¼å¸¸å¤ç |
| | | loading.close(); |
| | | if ( |
| | | error.code === "ECONNABORTED" || |
| | | error.message === "Network Error" || |
| | | error.message.includes("timeout") |
| | | ) { |
| | | this.$message.error("请æ±è¶
æ¶ï¼è¯·ç¨åéè¯"); |
| | | } |
| | | return Promise.resolve(error.response); |
| | | // reject(error); |
| | | }); |
| | | |
| | | // // //妿ç»å½å¤±è´¥ï¼éè¦å·æ°éªè¯ç ç |
| | | // // this.$refs.refresh.createdCode(); |
| | | // // this.validCode = ""; //æ¸
空éªè¯ç è¾å
¥æ¡çå
容 |
| | | // } else { |
| | | // // console.log("error submit!!"); |
| | | // return false; |
| | | // } |
| | | // }); |
| | | // //妿ç»å½å¤±è´¥ï¼éè¦å·æ°éªè¯ç ç |
| | | // this.$refs.refresh.createdCode(); |
| | | // this.validCode = ""; //æ¸
空éªè¯ç è¾å
¥æ¡çå
容 |
| | | } else { |
| | | // console.log("error submit!!"); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | // CAå
å¯ç»å½ |
| | | passCAFree() { |