Browse Source

文本分析跳转

natasha 11 months ago
parent
commit
4cf405f9af

+ 2 - 2
src/api/ajax.js

@@ -336,11 +336,11 @@ export function compareSenTenceTime(data) {
 }
 }
 
 
 // 文本分析 
 // 文本分析 
-export function analysSubmit(data) {
+export function analysSubmit (data,AccessToken) {
     return request({
     return request({
         method: 'post',
         method: 'post',
         url: `/TeachingServer/TextAnalyser/Analyse`,
         url: `/TeachingServer/TextAnalyser/Analyse`,
-        params: getAccessToken(),
+        params: AccessToken?AccessToken:getAccessToken(),
         data,
         data,
     })
     })
 }
 }

+ 27 - 13
src/components/Adult/preview/ArticleViewChs/index.vue

@@ -308,27 +308,41 @@ export default {
         spinner: "el-icon-loading",
         spinner: "el-icon-loading",
         background: "rgba(0, 0, 0, 0.7)"
         background: "rgba(0, 0, 0, 0.7)"
       });
       });
-      analysSubmit({
-        app_user_id: "",
-        text: this.curQue.article
-      })
-        .then(res => {
-          if (this.tokenData && this.tokenData.user_type === "APP") {
+      if (this.tokenData && this.tokenData.user_type === "APP") {
+        analysSubmit(
+          {
+            app_user_id: "",
+            text: this.curQue.article
+          },
+          { AccessToken: this.$route.query.AccessToken }
+        )
+          .then(res => {
             window.open(
             window.open(
               window.location.origin +
               window.location.origin +
                 `/GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析&AppID=${this.$route.query.AppID}&AccessToken=${this.$route.query.AccessToken}&UserID=${this.$route.query.UserID}`
                 `/GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析&AppID=${this.$route.query.AppID}&AccessToken=${this.$route.query.AccessToken}&UserID=${this.$route.query.UserID}`
             );
             );
-          } else {
+
+            loading.close();
+          })
+          .catch(res => {
+            loading.close();
+          });
+      } else {
+        analysSubmit({
+          app_user_id: "",
+          text: this.curQue.article
+        })
+          .then(res => {
             window.open(
             window.open(
               window.location.origin +
               window.location.origin +
                 `/GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析`
                 `/GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析`
             );
             );
-          }
-          loading.close();
-        })
-        .catch(res => {
-          loading.close();
-        });
+            loading.close();
+          })
+          .catch(res => {
+            loading.close();
+          });
+      }
     },
     },
     //语音全屏
     //语音全屏
     fullScreen() {
     fullScreen() {

+ 27 - 14
src/components/Adult/preview/DialogueArticleViewChs/index.vue

@@ -264,28 +264,41 @@ export default {
         spinner: "el-icon-loading",
         spinner: "el-icon-loading",
         background: "rgba(0, 0, 0, 0.7)"
         background: "rgba(0, 0, 0, 0.7)"
       });
       });
-      analysSubmit({
-        app_user_id: "",
-        text: this.curQue.article
-      })
-        .then(res => {
-          if (this.tokenData && this.tokenData.user_type === "APP") {
+      if (this.tokenData && this.tokenData.user_type === "APP") {
+        analysSubmit(
+          {
+            app_user_id: "",
+            text: this.curQue.article
+          },
+          { AccessToken: this.$route.query.AccessToken }
+        )
+          .then(res => {
             window.open(
             window.open(
               window.location.origin +
               window.location.origin +
                 `/GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析&AppID=${this.$route.query.AppID}&AccessToken=${this.$route.query.AccessToken}&UserID=${this.$route.query.UserID}`
                 `/GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析&AppID=${this.$route.query.AppID}&AccessToken=${this.$route.query.AccessToken}&UserID=${this.$route.query.UserID}`
             );
             );
-          } else {
+
+            loading.close();
+          })
+          .catch(res => {
+            loading.close();
+          });
+      } else {
+        analysSubmit({
+          app_user_id: "",
+          text: this.curQue.article
+        })
+          .then(res => {
             window.open(
             window.open(
               window.location.origin +
               window.location.origin +
                 `/GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析`
                 `/GCLS-TC/#/textanalysis/Result?id=${res.record.id}&type=文本分析`
             );
             );
-          }
-
-          loading.close();
-        })
-        .catch(res => {
-          loading.close();
-        });
+            loading.close();
+          })
+          .catch(res => {
+            loading.close();
+          });
+      }
     },
     },
     goFullscreen() {
     goFullscreen() {
       var element = document.getElementById("articleBoby");
       var element = document.getElementById("articleBoby");

+ 1 - 1
src/utils/auth.js

@@ -63,7 +63,7 @@ export function CopyToClipboard(element, root) {
     });
     });
     window.getSelection().removeAllRanges();
     window.getSelection().removeAllRanges();
 }
 }
-export function getAccessToken() {
+export function getAccessToken () {
   const token = JSON.parse(localStorage.getItem(TokenKey));
   const token = JSON.parse(localStorage.getItem(TokenKey));
   return { AccessToken: token?.access_token || '' };
   return { AccessToken: token?.access_token || '' };
 }
 }