permission.js 327 B

1234567891011121314151617
  1. import store from '@/store'
  2. /**
  3. * 判定认证
  4. */
  5. export const isToken = function () {
  6. const userToken = uni.getStorageSync('token')
  7. const userMid = uni.getStorageSync('m_id')
  8. if (userToken || userMid) {
  9. return true;
  10. } else {
  11. uni.navigateTo({
  12. url: "/pages/login/index",
  13. });
  14. return false;
  15. }
  16. }