| | |
| | | <div class="text"> |
| | | <div class="logo"> |
| | | <img |
| | | src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__155eeb2ceaac89ec717869a050964a36.svg" |
| | | :src="imgUrl" |
| | | alt=""> |
| | | </div> |
| | | <div class="text-r"> |
| | |
| | | // username: "admin", |
| | | // password: "macro123", |
| | | }, |
| | | imgUrl:'', |
| | | loginRules: { |
| | | username: [ |
| | | { required: true, trigger: "blur", validator: validateUsername }, |
| | |
| | | pwdType: false, |
| | | }; |
| | | }, |
| | | created() { }, |
| | | created() { |
| | | 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: { |
| | | showPwd() { |
| | | if (!this.pwdType) { |
| | |
| | | }, |
| | | ...mapActions(["login"]), |
| | | handleLogin() { |
| | | console.log("in login"); |
| | | const { username, password } = this.loginForm; |
| | | const that = this; |
| | | console.log(this.login); |
| | | this.$axios |
| | | .post("http://42.193.1.25:8082/sccg/admin/login", { |
| | | .post("sccg/admin/login", { |
| | | password, |
| | | username, |
| | | }) |
| | | .then(function (response) { |
| | | if (response.data.code === 200) { |
| | | if (response.code === 200) { |
| | | // 设置toke时间 |
| | | // 保存token |
| | | console.log(response); |
| | | localStorage.setItem('token',response.data.data.token); |
| | | sessionStorage.setItem('token',response.data.token); |
| | | // 保存token |
| | | localStorage.setItem('tokenHead',response.data.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 { |