|
@@ -64,25 +64,28 @@ export default {
|
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
|
});
|
|
|
- reqLogin(this.form)
|
|
|
- .then(res => {
|
|
|
- loading.close();
|
|
|
- localStorage.setItem("token", res.token);
|
|
|
- this.$router.replace ("/home/dashboard");
|
|
|
- // this.doOrganizationChoose();
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.log("登录失败", err);
|
|
|
- });
|
|
|
- // this.$axios.post(`http://121.37.169.186:8081/my/login?accountName=${this.form.userName}&password=${this.form.userPwd}`)
|
|
|
- // .then(res => {
|
|
|
- // loading.close();
|
|
|
- // if(res.data.code === 10000) {
|
|
|
- // localStorage.setItem('accountName', res.data.accountName);
|
|
|
- // } else {
|
|
|
- // this.$message.error(res.data.message);
|
|
|
- // }
|
|
|
- // })
|
|
|
+ // reqLogin(this.form)
|
|
|
+ // .then(res => {
|
|
|
+ // loading.close();
|
|
|
+ // localStorage.setItem("token", res.token);
|
|
|
+ // this.$router.replace ("/home/dashboard");
|
|
|
+ // // this.doOrganizationChoose();
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // console.log("登录失败", err);
|
|
|
+ // });
|
|
|
+ this.$axios.post(`http://121.37.169.186:8081/my/login?accountName=${this.form.userName}&password=${this.form.userPwd}`)
|
|
|
+ .then(res => {
|
|
|
+ loading.close();
|
|
|
+ if(res.data.code === 10000) {
|
|
|
+ localStorage.setItem("token", res.data.token);
|
|
|
+
|
|
|
+ localStorage.setItem('accountName', res.data.accountName);
|
|
|
+ this.$router.replace ("/home/dashboard");
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
handleSet: function() {
|
|
|
if (!this.orgSelected) {
|