From fd705320bdb8868e55f3f5b4825add36d283b15c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Fri, 26 May 2023 10:46:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- src/utils/request.js | 1 - src/utils/sist.js | 190 ------------------------------------------- 4 files changed, 2 insertions(+), 193 deletions(-) delete mode 100644 src/utils/sist.js diff --git a/.env.development b/.env.development index 22ff7c3..4f92344 100644 --- a/.env.development +++ b/.env.development @@ -6,7 +6,7 @@ ENV = 'development' #VUE_APP_BASE_API = 'http://localhost:8085/dev-api' #VUE_APP_BASE_API = '/dev-api' SITE_TYPE = 'NEd5n92EMIpyyBslaNqsRgE' -VUE_APP_BASE_API = 'http://dpapi.feashow.cn' +VUE_APP_BASE_API = 'https://dpapi.monbeli.com' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/.env.production b/.env.production index b4b6e5c..87d2adc 100644 --- a/.env.production +++ b/.env.production @@ -3,4 +3,4 @@ ENV = 'production' # EBTS/生产环境 #VUE_APP_BASE_API = '/prod-api' -VUE_APP_BASE_API = 'http://dpapi.feashow.cn' +VUE_APP_BASE_API = 'https://dpapi.monbeli.com' diff --git a/src/utils/request.js b/src/utils/request.js index 24fd9c8..baf95ab 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,7 +1,6 @@ import axios from 'axios' import {Notification, Message} from 'element-ui' import errorCode from '@/utils/errorCode' -import {setAppLanguage} from "@/utils/sist"; //todo 显示消息处理 diff --git a/src/utils/sist.js b/src/utils/sist.js deleted file mode 100644 index e82436c..0000000 --- a/src/utils/sist.js +++ /dev/null @@ -1,190 +0,0 @@ -/** - * @author: Clay - * @date: 2022/1/16 11:13 - * @description:sist - * @email: clay@hchyun.com - */ -let vm = null - -import {info} from "@/api"; - -export function setThis(that) { - vm = that -} - -export function getParentNode(id) { - try { - let menuList = JSON.parse(sessionStorage.getItem("menu")); - for (let menu of menuList) { - for (let child of menu.children) { - if (id == child.encodeId) { - menu.children = [] - child.children = [] - return { - stair: menu, second: child, - } - } - for (let item of child.children) { - if (id == item.encodeId) { - menu.children = [] - child.children = [] - item.children = [] - return { - stair: menu, second: child, three: item - } - } - } - } - } - return null - } catch (e) { - return null - } -} - - -export function getNodeMenu(id) { - try { - let menuList = JSON.parse(sessionStorage.getItem("menu")); - for (let menu of menuList) { - for (let child of menu.children) { - for (let item of child.children) { - if (id == item.encodeId) { - return item - } - } - } - } - return null - } catch (e) { - return null - } -} - -export function setAppLanguage() { - let lang = sessionStorage.getItem("lang"); - if (lang != null) { - vm.$i18n.locale = lang - return - } - var language = window.navigator.userLanguage || window.navigator.language; - if (language == 'zh-CN') { - lang = 'cn' - } else { - lang = 'en' - } - vm.$i18n.locale = lang - sessionStorage.setItem("lang", lang) -} - -export function setLanguage() { - let lang = vm.$route.query && vm.$route.query.lang - if (lang != undefined) { - vm.$i18n.locale = lang - sessionStorage.setItem("lang", lang) - } -} - - -export function toArticle(news, width) { - console.log(width, "width") - info(news.id).then(res => { - let info = null - try { - info = getParentNode(res.data.encodeId) - console.log(info) - } catch (e) { - } - if (info == null) { - return - } - let routeData = null; - if (info.three == null) { - if (width) { - routeData = "/pc/" + info.second.encodeId + "?id=" + news.id + "&type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"); - } else { - routeData = "/mobile/" + info.second.encodeId + "?id=" + news.id + "&type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"); - } - } else { - console.log(info.three, "toArticle,info.three") - if (width) { - routeData = "/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id + "&lang=" + sessionStorage.getItem("lang"); - } else { - routeData = "/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id + "&lang=" + sessionStorage.getItem("lang"); - } - } - linkTo(routeData) - }) -} - -function linkTo(routeData) { - let userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 - if (userAgent.indexOf("Safari") > -1) { - window.location.href = window.location.origin + routeData - } else { - window.open(routeData.href, "_blank") - } -} - - -export function lookMoreComment(item, width) { - info(item.id).then(res => { - let info = null - try { - info = getParentNode(res.data.encodeId) - } catch (e) { - } - if (info == null) { - return - } - if (info.three == null) { - if (width) { - vm.$router.push("/pc/" + info.second.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang")); - } else { - vm.$router.push("/mobile/" + info.second.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang")); - } - } else { - if (width) { - vm.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang")); - } else { - vm.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang")); - } - } - }) -} - - -export function lookMoreFixedComment(id, width) { - let info = null - try { - info = getParentNode(id) - console.log(info) - } catch (e) { - } - if (info == null) { - return - let routeData = null; - if (info.three == null) { - if (width) { - routeData = "/pc/" + info.second.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"); - } else { - routeData = "/mobile/" + info.second.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"); - } - } else { - if (width) { - routeData = "/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"); - } else { - routeData = "/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"); - } - } - linkTo(routeData) - // window.location.href = window.location.origin + routeData.href - // window.open(window.location.origin + routeData.href, "_blank") - } -} - - - - - -