CheckPrem.js 566 B

12345678910111213141516171819
  1. import {Toast,} from "@ant-design/react-native";
  2. import SyncStorage from "sync-storage";
  3. const CheckPrem = (navetion, premission, check = true) => {
  4. const premissions = SyncStorage.get('premissions');
  5. if (navetion && check) {
  6. if (!premission || premissions.indexOf(premission) > -1) {
  7. return true
  8. } else {
  9. Toast.info("您暂无权限使用此功能", 1)
  10. return false
  11. }
  12. } else {
  13. Toast.info("该功能正在加班研发中...", 1)
  14. return false
  15. }
  16. }
  17. export default CheckPrem;