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