|
@@ -13,33 +13,23 @@
|
|
|
<script>
|
|
<script>
|
|
|
import '@/assets/style/reset.less'
|
|
import '@/assets/style/reset.less'
|
|
|
import '@/assets/style/public.less'
|
|
import '@/assets/style/public.less'
|
|
|
-import axios from '@/utils/request'
|
|
|
|
|
|
|
+import { isPROD, isMobile } from '@/utils/static'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- baseURL: ''
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 移动端和pc端切换
|
|
// 移动端和pc端切换
|
|
|
created() {
|
|
created() {
|
|
|
- console.log(axios.defaults.baseURL, 'axios.defaults.baseURL')
|
|
|
|
|
- this.baseURL = axios.defaults.baseURL
|
|
|
|
|
// pc代码,但是手机端进来
|
|
// pc代码,但是手机端进来
|
|
|
- if (
|
|
|
|
|
- window.navigator.userAgent.match(
|
|
|
|
|
- /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
|
|
|
- )
|
|
|
|
|
- ) {
|
|
|
|
|
- if (this.baseURL === 'http://192.168.20.245:8005/' || '') {
|
|
|
|
|
- console.log(window.location.href, 'window.location.hre1f')
|
|
|
|
|
- if (window.location.href.includes('webM')) return
|
|
|
|
|
- window.location.href = window.location.href.replace("web", "webM")
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- // 移动端代码,但是pc端进来
|
|
|
|
|
- if (this.baseURL === 'http://192.168.20.245:8005/' || '') {
|
|
|
|
|
- console.log(window.location.href, 'window.location.hre2f')
|
|
|
|
|
- window.location.href = window.location.href.replace("webM", "web")
|
|
|
|
|
|
|
+ if (isMobile) {
|
|
|
|
|
+ if (isPROD) {
|
|
|
|
|
+ window.location.href = window.location.href.replace("web/index.html", "webM/index.html")
|
|
|
|
|
+ // 记得强刷一次页面
|
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
|
+ // location.reload(true)
|
|
|
|
|
+ // }, 200)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|