Browse Source

feat: test

gemercheung 1 year ago
parent
commit
ce623cb858
1 changed files with 8 additions and 1 deletions
  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) {