瀏覽代碼

feat: test

gemercheung 1 年之前
父節點
當前提交
ce623cb858
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      packages/qjkankan-editor/src/framework/material/header.vue

+ 8 - 1
packages/qjkankan-editor/src/framework/material/header.vue

@@ -54,6 +54,7 @@
 <script>
 import UserInfo from "@/components/userInfo.vue";
 import { i18n } from "@/lang";
+import browser from "@/utils/browser";
 
 export default {
   components: {
@@ -114,7 +115,13 @@ export default {
   methods: {
     changeLanguage(lang) {
       let arr = location.href.split("#/");
-      location.href = `material.html?lang=${lang}#/${arr[1]}`;
+      const from = browser.urlQueryValue("from");
+      if (from) {
+        location.href = `material.html?lang=${lang}&from=${from}#/${arr[1]}`;
+      } else {
+        location.href = `material.html?lang=${lang}#/${arr[1]}`;
+      }
+
       localStorage.language = lang;
     },
     handleItem(item) {