Selaa lähdekoodia

文本分析工具集成

natasha 9 kuukautta sitten
vanhempi
commit
4680bd51bf
1 muutettua tiedostoa jossa 17 lisäystä ja 3 poistoa
  1. 17 3
      src/views/Textanalysis/index.vue

+ 17 - 3
src/views/Textanalysis/index.vue

@@ -955,9 +955,10 @@ import * as echarts from 'echarts';
 import 'echarts/lib/chart/bar';
 import 'echarts/lib/component/legend';
 import 'echarts/lib/component/title';
-import { reparse, publicMethods, GetTextAnalyseRecordInfo } from '@/api/api';
+import { reparse, publicMethods, GetTextAnalyseRecordInfo, getStaticContent } from '@/api/api';
 import { levelMap } from '../../common/data';
 import { json2excel } from '@/utils/setMethods';
+import { setToken } from '@/utils/auth';
 
 import FileSaver from 'file-saver';
 import htmlDocx from 'html-docx-js/dist/html-docx';
@@ -1032,14 +1033,27 @@ export default {
       textContent: [],
       routerData: null,
       id: null,
-      userID: this.$route.query.userID,
+      userID: this.$route.query.userID || this.$route.query.UserID,
+      AccessToken: this.$route.query.AccessToken,
+      AppID: this.$route.query.AppID,
       cixing: false, // 词性开关
       editArticleFlag: false, // 修改文本
       noPosContent: '',
       cixing_ttr_list: [],
     };
   },
-  created() {
+  async created() {
+    const _this = this;
+    if (this.AccessToken) {
+      const Mname = 'login_control-ParseAccessToken';
+      await getStaticContent(Mname, {
+        access_token: _this.AccessToken,
+      }).then((res) => {
+        res.access_token = _this.AccessToken;
+        setToken(res);
+        sessionStorage.setItem('GCLS_Token_Tc', JSON.stringify(res));
+      });
+    }
     this.routerData = this.$route.query;
     if (!this.routerData) return;
     this.id = this.routerData.id;