From 5e6d90d244d3b2d150d7d78a7a9d36b0a26ce402 Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Wed, 22 May 2024 22:04:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/js/http.js | 4 +- src/views/home/login_v2.vue | 116 +++++++++++------- .../componentsModule/dataInfoFormData.vue | 17 ++- src/views/workSpace/index.vue | 23 ---- 4 files changed, 87 insertions(+), 73 deletions(-) diff --git a/src/assets/js/http.js b/src/assets/js/http.js index 6778e31c..08e97487 100644 --- a/src/assets/js/http.js +++ b/src/assets/js/http.js @@ -84,8 +84,8 @@ if (process.env.NODE_ENV == 'development') { // axios.defaults.baseURL ='http://101.43.164.214:45011/' //上海优益(上海建工) // axios.defaults.baseURL = 'http://192.168.34.221:28888/' //郭圣雄本地 // axios.defaults.baseURL = 'http://192.168.34.221:28889/' //郭圣雄本地 - axios.defaults.baseURL ='http://192.168.34.221:9111/' //郭圣雄本地 - // axios.defaults.baseURL = 'http://192.168.34.155:19111/' //彭洁本地 + // axios.defaults.baseURL ='http://192.168.34.221:9111/' //郭圣雄本地 + axios.defaults.baseURL = 'http://192.168.34.155:19111/' //彭洁本地 // axios.defaults.baseURL = 'http://182.90.224.237:51234' //郭圣雄远程 // axios.defaults.baseURL = 'http://jxj.zhgdyun.com:61212/' //彭洁远程 // axios.defaults.baseURL ='http://101.43.164.214:45020/' //沈阳和盈 diff --git a/src/views/home/login_v2.vue b/src/views/home/login_v2.vue index 59332289..d62f7fe8 100644 --- a/src/views/home/login_v2.vue +++ b/src/views/home/login_v2.vue @@ -98,7 +98,7 @@ @@ -115,7 +115,7 @@ @@ -237,7 +237,7 @@ @@ -254,7 +254,7 @@ @@ -273,7 +273,7 @@ @@ -288,7 +288,7 @@ @@ -407,7 +407,7 @@ import { companyLoginApi, projectLoginApi, newRegisterApi, - jumpLargeUserInfoApi + jumpLargeUserInfoApi, } from "@/assets/js/api/loginSign"; import { selectSystemLogoConfigApi } from "@/assets/js/api/jxjadmin"; import getcode from "@/components/getMsgCode"; @@ -433,7 +433,8 @@ export default { passWord: [ { required: true, message: "请输入新密码", trigger: "blur" }, { - pattern: /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+~`\-={}[\]:";'<>?,./])[a-zA-Z\d!@#$%^&*()_+~`\-={}[\]:";'<>?,./]{8,}$/, + pattern: + /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+~`\-={}[\]:";'<>?,./])[a-zA-Z\d!@#$%^&*()_+~`\-={}[\]:";'<>?,./]{8,}$/, message: "密码必须包含至少一个字母、一个数字、一个特殊字符以及长度至少为8位数", trigger: "blur", @@ -495,7 +496,8 @@ export default { pw: [ { required: true, - message: "密码至少一个字母、一个数字、一个特殊字符以及长度至少为8位数", + message: + "密码至少一个字母、一个数字、一个特殊字符以及长度至少为8位数", trigger: "blur", pattern: /(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^0-9a-zA-Z]).{8,30}/, }, @@ -560,66 +562,65 @@ export default { // } }, created() { - this.company = COMPANY - this.projectType = PROJECT_TYPE + this.company = COMPANY; + this.projectType = PROJECT_TYPE; setTimeout(() => { //删除401标识 - sessionStorage.setItem('errorResponse',null); - },3000) + sessionStorage.setItem("errorResponse", null); + }, 3000); if (this.$route.query.headquartersSn) { - this.headquartersSnData = this.$route.query.headquartersSn + this.headquartersSnData = this.$route.query.headquartersSn; } else { - this.headquartersSnData = "" + this.headquartersSnData = ""; } // else { // this.headquartersSnData = this.$store.state.userInfo?.headquartersSn ? this.$store.state.userInfo.headquartersSn : '' // } //兼容第三方平台接入 ---做免码登录 - if (window.location.href.indexOf('UID') != -1) { + if (window.location.href.indexOf("UID") != -1) { // debugger; - this.$store.commit('setUid', true) + this.$store.commit("setUid", true); // let str = window.location.href.split("UID=")[1]; - let uid = window.location.href.split('UID=')[1] + let uid = window.location.href.split("UID=")[1]; // let uid = str.substring(0, str.length - 7); let data = { - uid - } + uid, + }; //获取到用户信息 getUserByUidApi(data).then((res) => { if (res.code == 200) { //赋值 - this.parseLoginData(res.result) + this.parseLoginData(res.result); } else { - this.$message.error(res.message) + this.$message.error(res.message); } - }) - } - else if(window.location.href.indexOf("token") != -1){ + }); + } else if (window.location.href.indexOf("token") != -1) { const newToken = window.location.href.split("token=")[1]; const data = { token: newToken }; jumpLargeUserInfoApi(data).then((res) => { if (res.code == 200) { //赋值 - this.parseLoginData(res.result, true) + this.parseLoginData(res.result, true); } else { - this.$message.error(res.message) + this.$message.error(res.message); } - }) + }); } else { this.isShowContent = true; - this.$store.commit('setUid', false) - this.getDetail(this.headquartersSnData) - this.getData() + this.$store.commit("setUid", false); + this.getDetail(this.headquartersSnData); + this.getData(); } }, mounted() { // this.$bus.$on('resetSlideVerify',this.onReset) - delete this.$http.defaults.headers.common['Authorization'] - if (window.location.href.indexOf('type=lgzbdp') != -1) { - window.localStorage.setItem('isIframe', '1') + delete this.$http.defaults.headers.common["Authorization"]; + if (window.location.href.indexOf("type=lgzbdp") != -1) { + window.localStorage.setItem("isIframe", "1"); } else { - if (window.localStorage.getItem('isIframe')) { - window.localStorage.removeItem('isIframe') + if (window.localStorage.getItem("isIframe")) { + window.localStorage.removeItem("isIframe"); } } }, @@ -698,7 +699,7 @@ export default { // 去注册 goRegister() { this.isLogin = false; - this.registerType = this.loginType + this.registerType = this.loginType; this.registerForm = { account: "", pw: "", @@ -794,7 +795,7 @@ export default { this.$store.commit("setProDetail", null); this.$store.commit("setProjectSn", ""); this.$store.commit("setGroupTreeList", []); - this.$store.commit('setSelectedGroupSn', null); + this.$store.commit("setSelectedGroupSn", null); window.localStorage.removeItem("isIframe"); window.localStorage.removeItem("soundList"); @@ -1006,7 +1007,7 @@ export default { headquartersSn: this.headquartersSnData, accountType: this.registerType, }).then((res) => { - if(this.registerType == 1){ + if (this.registerType == 1) { this.$message.success("注册成功,等待审核"); } else { this.$message.success("注册成功"); @@ -1031,13 +1032,34 @@ export default { } }); }, - parseLoginData(data,isOutside) { + + checkInfoComplete() { + this.$confirm( + "系统检测到您未完善邮箱,请去后台中心完善,以免忘记密码时无法通过邮箱验证,导致重置密码失败!", + "温馨提示", + { + confirmButtonText: "用户中心", + cancelButtonText: "取消", + type: "warning", + } + ) + .then(() => { + this.$router.push("/userCenter/userConfig"); + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消", + }); + }); + }, + parseLoginData(data, isOutside) { if (this.projectType == "zjsj") { this.$store.commit("setProjectSn", data.sn); } window._paq.push(["trackEvent", "点击", "登录", "登录账号"]); - if(!isOutside){ - this.$message.success(this.$t('message.login.login_success_msg')) //登录成功! + if (!isOutside) { + this.$message.success(this.$t("message.login.login_success_msg")); //登录成功! } this.$http.defaults.headers.common["Authorization"] = "Bearer" + " " + data.token; @@ -1052,7 +1074,9 @@ export default { var projectModule = []; if ( moduleList.length == 0 && - data.accountType != 1 && data.accountType != 10 && data.accountType != 11 + data.accountType != 1 && + data.accountType != 10 && + data.accountType != 11 ) { this.$message.warning("当前账号还没分配权限"); return false; @@ -1154,6 +1178,9 @@ export default { if (!arr2.length) { if (this.loginType == 1) { // this.$router.push("/projectIndex"); + if (!this.$store.state.userInfo.personMail) { + this.checkInfoComplete(); + } this.$router.push("/workSpace"); } else { this.$router.push("/supplierIndex"); @@ -1169,6 +1196,9 @@ export default { ) { if (this.loginType == 1) { // this.$router.push("/projectIndex"); + if (!this.$store.state.userInfo.personMail) { + this.checkInfoComplete(); + } this.$router.push("/workSpace"); } else { this.$router.push("/supplierIndex"); diff --git a/src/views/userCenter/userCenter/componentsModule/dataInfoFormData.vue b/src/views/userCenter/userCenter/componentsModule/dataInfoFormData.vue index 5b56835c..5171f79e 100644 --- a/src/views/userCenter/userCenter/componentsModule/dataInfoFormData.vue +++ b/src/views/userCenter/userCenter/componentsModule/dataInfoFormData.vue @@ -27,12 +27,14 @@ :src="$store.state.FILEURL + this.ruleForm.avatar" class="avatar" /> --> - -
+ class="avatar" + > +
@@ -155,6 +157,11 @@ export default { }; getSystemUserInfoApi(requestData).then((res) => { that.ruleForm = { ...res.result }; + let originUserInfo = this.$store.state.userInfo; + that.$store.commit("setUserInfo", { + ...originUserInfo, + ...that.ruleForm + }); }); }, beforeAvatarUpload(file) { @@ -252,7 +259,7 @@ export default { width: 178px; height: 178px; display: block; - .image-slot{ + .image-slot { width: 100%; height: 100%; display: flex; diff --git a/src/views/workSpace/index.vue b/src/views/workSpace/index.vue index be7f46ab..069de5a2 100644 --- a/src/views/workSpace/index.vue +++ b/src/views/workSpace/index.vue @@ -86,9 +86,6 @@ export default { // this.selectGroupDialog = true; // } this.getGroupTreeData(); - if (!this.$store.state.userInfo.personMail) { - this.checkInfoComplete(); - } }, mounted() { // 挂载后来给iframe传递菜单数据 @@ -102,26 +99,6 @@ export default { iframe.removeEventListener("load", this.onIframeLoad); }, methods: { - checkInfoComplete() { - this.$confirm( - "系统检测到您未完善邮箱,请去后台中心完善,以免忘记密码时无法通过邮箱验证,导致重置密码失败!", - "温馨提示", - { - confirmButtonText: "用户中心", - cancelButtonText: "取消", - type: "warning", - } - ) - .then(() => { - this.$router.push("/userCenter/userConfig"); - }) - .catch(() => { - this.$message({ - type: "info", - message: "已取消", - }); - }); - }, // 查询全部模块 getModuleMenuList() { getNewUserAllModulePageApi({