소스 검색

词云接口添加token

natasha 1 년 전
부모
커밋
f1dd5f0103
1개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  1. 10 3
      public/ciyun/ciyunindex.html

+ 10 - 3
public/ciyun/ciyunindex.html

@@ -367,6 +367,13 @@
         var searchType = null;
         var old_searchType = null
         var W_stopWordStatus = null
+        var prefix = 'GCLS_Token='
+        var start = document.cookie.indexOf(prefix)
+        var end = document.cookie.indexOf(";", start + prefix.length)
+        if (end == -1) {
+            end = document.cookie.length;
+        }
+        var AccessToken = JSON.parse(unescape(document.cookie.substring(start + prefix.length, end))).access_token
         arr.forEach((item) => {
             if (item.split("=")[0] == "partitionKey") {
                 partitionKey = item.split("=")[1];
@@ -412,7 +419,7 @@
                 is_contain_stop_word: W_stopWordStatus ? 'true' : 'false',
             }
             $.ajax({
-                url: window.location.origin + "/TeachingServer/TextAnalyser/GetWordCloudData",
+                url: window.location.origin + "/TeachingServer/TextAnalyser/GetWordCloudData?AccessToken=" + AccessToken,
                 // url: "/i21st-newspaper-management-test/api/article/detail/wordCloud",
                 data: JSON.stringify(data),
                 contentType: "application/json",
@@ -525,7 +532,7 @@
 
         function initStopWords() {
             $.ajax({
-                url: window.location.origin + "/GCLSTCServer/tools/TS/stop/word/list",
+                url: window.location.origin + "/GCLSTCServer/tools/TS/stop/word/list?AccessToken=" + AccessToken,
                 // url: "/i21st-newspaper-management-test/api/user/stopVocab/get",
                 data: JSON.stringify({}),
                 contentType: "application/json;charset=UTF-8",
@@ -807,7 +814,7 @@
         function updatawordData() {
             let userStopVocab = JSON.parse(JSON.stringify(oldstopWordList));
             $.ajax({
-                url: window.location.origin + "/GCLSTCServer/tools/TS/stop/word/save",
+                url: window.location.origin + "/GCLSTCServer/tools/TS/stop/word/save?AccessToken=" + AccessToken,
                 // url: "/i21st-newspaper-management-test/api/user/stopVocab/update",
                 data: JSON.stringify({
                     tenantId: "",