lsc 2 years ago
parent
commit
803e0f4484
1 changed files with 15 additions and 13 deletions
  1. 15 13
      js/Office/Word/Word.js

+ 15 - 13
js/Office/Word/Word.js

@@ -628,19 +628,21 @@ U.MD.O.W.copyText = function (target) {
 }
 
 U.MD.O.W.getWork = async function (cid, s, task, t, uid) {
-    U.A.Request(US.Config.pbl + "selectWord?uid=" + uid + "&cid=" + cid + "&s=" + s + "&task=" + task + "&t=" + t, [], function (res) {
-        if (res.value[0].length > 0) {
-            US.wordRoomInfo = res.value[0][0];
-            // U.A.Request(US.SCOKET, ["getWord", rid, US.pageId, US.userInfo.userid], function(r) {
-            // U.MD.O.W.fileinfo.UsOffice = US.wordRoomInfo.text;
-            // U.MD.O.W.fileinfo.UserDirectoryID = rid;
-            // });
-            return res.value[0][0].text
-            // setTimeout(() => {
-            //     U.MD.O.W.wordDirectory();
-            // }, 100)
-        }
-    }, [], { "type": "GET", "withCredentials": true });
+    return new Promise((resolve, reject) => {
+        U.A.Request(US.Config.pbl + "selectWord?uid=" + uid + "&cid=" + cid + "&s=" + s + "&task=" + task + "&t=" + t, [], function (res) {
+            if (res.value[0].length > 0) {
+                US.wordRoomInfo = res.value[0][0];
+                // U.A.Request(US.SCOKET, ["getWord", rid, US.pageId, US.userInfo.userid], function(r) {
+                // U.MD.O.W.fileinfo.UsOffice = US.wordRoomInfo.text;
+                // U.MD.O.W.fileinfo.UserDirectoryID = rid;
+                // });
+                return res.value[0][0].text
+                // setTimeout(() => {
+                //     U.MD.O.W.wordDirectory();
+                // }, 100)
+            }
+        }, [], { "type": "GET", "withCredentials": true });
+    });
 }
 
 /**