|
@@ -5,6 +5,28 @@ import vuex from 'vuex'
|
|
import VueChatScroll from "vue-chat-scroll";
|
|
import VueChatScroll from "vue-chat-scroll";
|
|
import 'viewerjs/dist/viewer.css'
|
|
import 'viewerjs/dist/viewer.css'
|
|
import Viewer from 'v-viewer'
|
|
import Viewer from 'v-viewer'
|
|
|
|
+
|
|
|
|
+var isProduction = process.env.NODE_ENV === "production";
|
|
|
|
+isProduction && checkDeviceAndRedirect();
|
|
|
|
+
|
|
|
|
+function isMobile() {
|
|
|
|
+ const userAgent = navigator.userAgent.toLowerCase();
|
|
|
|
+ return /iphone|ipod|android|windows phone|blackberry|mobile/i.test(userAgent);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function checkDeviceAndRedirect() {
|
|
|
|
+ const isMobileDevice = isMobile();
|
|
|
|
+ const currentPath = window.location.pathname;
|
|
|
|
+ const isInMobilePath = currentPath.includes("/mobile/");
|
|
|
|
+ const isInPCPath = currentPath.includes("/web/");
|
|
|
|
+
|
|
|
|
+ if (isMobileDevice && !isInMobilePath) {
|
|
|
|
+ window.location.href = currentPath.replace("/web/", "/mobile/");
|
|
|
|
+ } else if (!isMobileDevice && !isInPCPath) {
|
|
|
|
+ window.location.href = currentPath.replace("/mobile/", "/web/");
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
Vue.use(Viewer,{
|
|
Vue.use(Viewer,{
|
|
defaultOptions: {
|
|
defaultOptions: {
|
|
navbar:false,
|
|
navbar:false,
|