| | |
| | | }; |
| | | }, |
| | | created() { |
| | | const pic = JSON.parse(localStorage.getItem('pic')); |
| | | const pic = JSON.parse(sessionStorage.getItem('pic')); |
| | | if(pic){ |
| | | this.imgUrl = pic.loginPageIconUrl |
| | | }else{ |
| | | this.$axios({ |
| | | method: 'get', |
| | | url: 'sccg/system/portal/logo/search', |
| | | }).then(res => { |
| | | this.imgUrl = res.data.loginPageIconUrl |
| | | }) |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | }, |
| | | ...mapActions(["login"]), |
| | | handleLogin() { |
| | | console.log("in login"); |
| | | const { username, password } = this.loginForm; |
| | | const that = this; |
| | | console.log(this.login); |
| | | this.$axios |
| | | .post("sccg/admin/login", { |
| | | password, |
| | |
| | | }) |
| | | .then(function (response) { |
| | | if (response.code === 200) { |
| | | // 设置toke时间 |
| | | // 保存token |
| | | console.log(response); |
| | | localStorage.setItem('token',response.data.token); |
| | | sessionStorage.setItem('token',response.data.token); |
| | | // 保存token |
| | | localStorage.setItem('tokenHead',response.data.tokenHead) |
| | | sessionStorage.setItem('tokenHead',response.data.tokenHead); |
| | | // 保存用户登录名 |
| | | sessionStorage.setItem('name',username); |
| | | // 跳转到首页 |
| | | that.$router.push("/home"); |
| | | }else{ |
| | | that.$refs.loginForm.validate((valid)=>{ |
| | | if(valid){ |
| | | that.$message.error(response.data.message); |
| | | that.$message({ |
| | | type:'warning', |
| | | message:response.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | top: 20%; |
| | | right: 5%; |
| | | width: 360px; |
| | | &:deep(.el-input__inner){ |
| | | background-color: #fff !important; |
| | | border: 1px solid #dcdfe6 !important; |
| | | } |
| | | } |
| | | |
| | | .text { |
| | |
| | | .logo>img { |
| | | width: 75px; |
| | | height: 75px; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .text-r { |