useApp.js 735 B

1234567891011121314151617181920212223242526272829303132
  1. import sheep from '@/sheep';
  2. import {
  3. computed
  4. } from 'vue';
  5. // 用户信息
  6. const userInfo = computed(() => sheep.$store('user').userInfo);
  7. /**
  8. * 判断内测资格
  9. * @return {boolean} 当前用户是否是内测用户
  10. */
  11. export function isBetaUser() {
  12. const username = userInfo.value.username;
  13. return username === 'ru10' || username === '迷鹿' || username === '非繁';
  14. }
  15. /**
  16. * 判断是否安卓打开
  17. * @return { String } 是否是安卓打开
  18. */
  19. export function isAndroid() {
  20. return window.Android && window.Android.getIdentifier();
  21. }
  22. /**
  23. * 拿到安卓极光id
  24. * @return { String } 是否是安卓打开
  25. */
  26. export function getAndroidJiGuangId() {
  27. return window.Android && window.Android.getRegistrationID();
  28. }