| | |
| | | //设置在登录状态 |
| | | this.isLoging = true; |
| | | |
| | | this.$axios.get("/api/user/login",{ |
| | | this.$axios({ |
| | | method: 'get', |
| | | url:"/api/user/login", |
| | | params: loginParam |
| | | } ) |
| | | .then(function (res) { |
| | | }).then(function (res) { |
| | | console.log(JSON.stringify(res)); |
| | | if (res.data == "success") { |
| | | that.$cookies.set("session", {"username": that.username}) ; |
| | |
| | | type: 'error' |
| | | }); |
| | | } |
| | | }) |
| | | .catch(function (error) { |
| | | that.$message.error(error.response.statusText); |
| | | }).catch(function (error) { |
| | | that.$message.error(error.response.data.msg); |
| | | that.isLoging = false; |
| | | }); |
| | | }, |