history.ts 822 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { createHashHistory } from 'history'
  2. import { envFlag } from './http'
  3. const history = createHashHistory()
  4. export default history
  5. // 判断是手机端还是pc端
  6. export const isMobileFu = () => {
  7. if (
  8. window.navigator.userAgent.match(
  9. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  10. )
  11. ) {
  12. return true
  13. } else return false
  14. }
  15. export const myUrl = envFlag ? myUrlTemp1 : myUrlTemp2
  16. export type HomeDataRow = {
  17. id: number
  18. videoUrl: string
  19. name: string
  20. cover: string
  21. modelUrl: string
  22. txt: string
  23. text: string
  24. age: string
  25. level: string
  26. }
  27. export const myData: {
  28. homeBg: string
  29. homeTitleImg: string
  30. nameImg: string
  31. infoImg: string
  32. homeData: HomeDataRow[]
  33. } = myDataTemp