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.

28 lines
677 B

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