From d233d809dd78aa2bf973cdb2ad577dc823eb6ddc Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期二, 28 二月 2023 11:45:36 +0800
Subject: [PATCH] 2023/2/28 肖辉 违建登记添加-身份证正反面调整
---
src/views/login/index.vue | 53 +++++++++++++++++++++++++++++++++++++----------------
1 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index e028946..3448171 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -4,7 +4,7 @@
<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">
@@ -55,6 +55,8 @@
<script>
import { isvalidUsername } from "@/utils/validate";
import { createNamespacedHelpers } from "vuex";
+import users from "@/api/users";
+
const { mapActions } = createNamespacedHelpers("users");
export default {
name: "login",
@@ -77,9 +79,8 @@
loginForm: {
username:"",
password:"",
- // username: "admin",
- // password: "macro123",
},
+ imgUrl:'',
loginRules: {
username: [
{ required: true, trigger: "blur", validator: validateUsername },
@@ -92,42 +93,57 @@
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) {
- this.pwdType = true;
- } else {
- this.pwdType = false;
- }
+ this.pwdType = !this.pwdType;
},
...mapActions(["login"]),
handleLogin() {
- console.log("in login");
const { username, password } = this.loginForm;
const that = this;
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
+ sessionStorage.setItem('token',response.data.token);
+ // 淇濆瓨token
+ 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
+ })
}
})
}
- console.log(response);
})
.catch(function (error) {
- console.log(error);
});
- },
+ }
},
};
</script>
@@ -152,6 +168,10 @@
top: 20%;
right: 5%;
width: 360px;
+ &:deep(.el-input__inner){
+ background-color: #fff !important;
+ border: 1px solid #dcdfe6 !important;
+ }
}
.text {
@@ -166,6 +186,7 @@
.logo>img {
width: 75px;
height: 75px;
+ border-radius: 4px;
}
.text-r {
--
Gitblit v1.8.0