diff --git a/src/store/modules/user.js b/src/store/modules/user.js index a9f96bc..843c657 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -221,10 +221,12 @@ const user = { let userIdentity let userInfo = Vue.ls.get(USER_INFO) // userInfo.companyRole,企业角色:1--普通企业;2--会员企业 + // userInfo.roleCode 1--企业联系人、2--企业管理员(会员企业) 3、企业管理员 + if (userInfo.companyRole + '' === '1') { userIdentity = '0' } else { - // userInfo.roleCode,企业用户角色:1--企业联系人、2--企业管理员 + // userInfo.roleCode,企业用户角色:1--企业联系人、2--企业管理员(会员企业) 3、企业管理员 if (userInfo.roleCode + '' === '2') { userIdentity = '1' } else { @@ -236,15 +238,20 @@ const user = { } } } + // 通过roleCode === 3 判断是否显示人员信息 + let allMenuData = [] + if(userInfo.roleCode + '' !== '3' ){ + allMenuData = routerData.filter(menu => menu.id !== '16') + } /**判断用户角色-end*/ switch (userIdentity) { // 不是标协会员,则不显示标协会员的全部菜单 case '0': - menuData = routerData.filter(tt => tt.id.indexOf('standards') === -1) + menuData = allMenuData.filter(tt => tt.id.indexOf('standards') === -1) break // 是标协会员企业管理员,显示系统全部菜单 case '1': - menuData = routerData + menuData = allMenuData break // 是标协会员但不是企业管理员,不显示标协会员下的会员管理、证书管理、缴费信息、理事会四个菜单 case '2': @@ -260,7 +267,7 @@ const user = { break // 是标协会员理事,不显示标协会员下的会员管理、证书管理、缴费信息三个菜单 case '3' : - routerData.forEach(item => { + allMenuData.forEach(item => { if (item.children && item.children.length > 0) { let tt = item tt.children = item.children.filter(aa => (aa.id.indexOf('standardsMemberManagement') === -1 && aa.id.indexOf('standardsCertificateManagement') === -1 && aa.id.indexOf('standardsPaymentInfo') === -1)) @@ -271,7 +278,7 @@ const user = { }) break default: - menuData = routerData + menuData = allMenuData } const authData = [] const allAuthData = [] diff --git a/src/views/user/alteration/Alteration.vue b/src/views/user/alteration/Alteration.vue index 820bd9c..7709151 100644 --- a/src/views/user/alteration/Alteration.vue +++ b/src/views/user/alteration/Alteration.vue @@ -130,7 +130,7 @@ export default { rules: [ {required: true, message: '请输入新密码!'}, { - pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/, + pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,30}$/, message: '密码由8位及以上数字、大小写字母和特殊符号组成!' } ], @@ -153,6 +153,7 @@ export default { }, userList: {}, temporaryUserInfo: null, // 临时用户数据 + loginType:false, // true => 管理员登录 false =>联系人登录 } }, created() { @@ -161,12 +162,13 @@ export default { if (this.$route.query.isFirstLogin === 'true') { this.getPublicKey() this.temporaryUserInfo = Vue.ls.get('Enterprise_TemporaryUserInfo') + console.log(this.temporaryUserInfo,'temporaryUserInfotemporaryUserInfo') + this.loginType = this.temporaryUserInfo.result.userInfo.roleCode+'' === '3' } }, methods: { ...mapActions(['FirstPhoneLogin']), submit() { - let that = this that.loading = true this.form.validateFields((err, values) => { @@ -181,12 +183,12 @@ export default { params.phone = encrypt.encrypt(values.phone) params.verifyCode = values.captcha params.password = encrypt.encrypt(values.password) - url = '/company/verificationChangePassword' + url = this.loginType ? '/companyManager/verificationChangePassword' : '/company/verificationChangePassword' } else { params.newPassword = encrypt.encrypt(values.password) // 初次登录用password字段存了token params.password = that.temporaryUserInfo.result.token - url = '/company/changePasswordWithToken' + url = this.loginType ? '/companyManager/changePasswordWithToken' :'/company/changePasswordWithToken' } params.verifyPassword = encrypt.encrypt(values.confirmPassword) postAction(url, params).then((res) => { @@ -262,7 +264,9 @@ export default { // 忘记密码是2 codeType: 2 } - getAction('/company/sendVerificationCode', smsParams).then(res => { + // ' + let url = this.loginType ? '/companyManager/sendVerificationCode' : '/company/sendVerificationCode' + getAction(url, smsParams).then(res => { if (!res.success) { setTimeout(hide, 1) this.cmsFailed(res.message)