history.ts 642 B

12345678910111213141516171819202122
  1. import { createHashHistory } from 'history'
  2. const history = createHashHistory()
  3. export default history
  4. // 判断是手机端还是pc端
  5. export const isMobileFu = () => {
  6. if (
  7. window.navigator.userAgent.match(
  8. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  9. )
  10. ) {
  11. return true
  12. } else return false
  13. }
  14. // 当前环境是 本地环境 还是 服务器环境
  15. export const isLoc = process.env.NODE_ENV === 'development'
  16. export const baseURL = isLoc ? baseUrlLoc : baseUrlAtl
  17. // 所有数据
  18. export const myData = myDataTemp