✨ feat:小程序角色权限控制

This commit is contained in:
Haiyi
2022-10-14 15:56:49 +08:00
parent 3f01990a35
commit 3111f211ae
11 changed files with 310 additions and 123 deletions
+11
View File
@@ -142,3 +142,14 @@ export const formatKbPrice = (number: string) => {
}, [])
return ret.reverse().join('')
}
/**
* 验证权限
* @param {权限key} key
* @returns
*/
export const checkKey = (key = "") => {
let getUser = JSON.parse(Taro.getStorageSync("userInfo"));
return getUser.mp_role_access_list?.includes(key);
};