update
This commit is contained in:
@@ -140,24 +140,32 @@ function returnFormatParams(params) {
|
||||
export async function hasPermission(params) {
|
||||
//如果是商户默认拥有全部权限
|
||||
const loginType=uni.getStorageSync('loginType')
|
||||
if(loginType=='merchant'){
|
||||
if(loginType=='0'){
|
||||
return true
|
||||
}
|
||||
params = returnFormatParams(params)
|
||||
if (!params) {
|
||||
return infoBox.showToast('未找到相关权限,请检查代码或在权限配置文件commons/utils/hasPermission.js文件进行修改或增加')
|
||||
}
|
||||
const option = Object.assign({
|
||||
tips: true,
|
||||
key: '',
|
||||
text: ''
|
||||
}, params)
|
||||
const res = await $hasPermission({
|
||||
code: params.key
|
||||
})
|
||||
if (!res && option.tips) {
|
||||
infoBox.showToast('您没有' + params.text + '权限!')
|
||||
}
|
||||
return res
|
||||
// const loginType=uni.getStorageSync('loginType')
|
||||
// if(loginType=='merchant'){
|
||||
// return true
|
||||
// }
|
||||
// params = returnFormatParams(params)
|
||||
// if (!params) {
|
||||
// return infoBox.showToast('未找到相关权限,请检查代码或在权限配置文件commons/utils/hasPermission.js文件进行修改或增加')
|
||||
// }
|
||||
// const option = Object.assign({
|
||||
// tips: true,
|
||||
// key: '',
|
||||
// text: ''
|
||||
// }, params)
|
||||
// const res = await $hasPermission({
|
||||
// code: params.key
|
||||
// })
|
||||
// if (!res && option.tips) {
|
||||
// infoBox.showToast('您没有' + params.text + '权限!')
|
||||
// }
|
||||
// return res
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user