old mode 100644
new mode 100755
| | |
| | | |
| | | <script> |
| | | import crypto from 'crypto' |
| | | import userService from "./service/UserService"; |
| | | export default { |
| | | name: 'Login', |
| | | data(){ |
| | |
| | | params: loginParam |
| | | }).then(function (res) { |
| | | window.clearTimeout(timeoutTask) |
| | | console.log(JSON.stringify(res)); |
| | | console.log(res); |
| | | console.log("登录成功"); |
| | | if (res.data.code === 0 ) { |
| | | that.$cookies.set("session", {"username": that.username,"roleId":res.data.data.role.id}) ; |
| | | userService.setUser(res.data.data) |
| | | //登录成功后 |
| | | that.cancelEnterkeyDefaultAction(); |
| | | that.$router.push('/'); |
| | |
| | | that.$message.error(error.response.data.msg); |
| | | that.isLoging = false; |
| | | }); |
| | | }, |
| | | setCookie: function (cname, cvalue, exdays) { |
| | | var d = new Date(); |
| | | d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); |
| | | var expires = "expires=" + d.toUTCString(); |
| | | console.info(cname + "=" + cvalue + "; " + expires); |
| | | document.cookie = cname + "=" + cvalue + "; " + expires; |
| | | console.info(document.cookie); |
| | | }, |
| | | cancelEnterkeyDefaultAction: function() { |
| | | document.onkeydown = function(e) { |