You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
602 B

8 months ago
  1. import Vue from "vue";
  2. import toast from "./toast/index.js";
  3. import { play } from '@/utils/clickSound.js'
  4. import dayjs from 'dayjs'
  5. Vue.prototype.$isAppFn = function(){
  6. if(typeof navigator == 'undefined'){
  7. return true
  8. }
  9. const userAgent = navigator.userAgent.toLowerCase();
  10. if (/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(userAgent)) {
  11. // 移动端
  12. console.log('移动端')
  13. return true
  14. }
  15. // pc端
  16. console.log('PC端')
  17. return false
  18. }
  19. Vue.prototype.$isApp = Vue.prototype.$isAppFn()
  20. Vue.prototype.$play = play
  21. Vue.prototype.$dayjs = dayjs
  22. Vue.use(toast)