Browse Source

websocket地址

xjj 2 years ago
parent
commit
f55a43445f
3 changed files with 4 additions and 5 deletions
  1. 2 2
      config/config.js
  2. 2 1
      src/pages/Detail/LuckySheet.js
  3. 0 2
      src/utils/utils.js

+ 2 - 2
config/config.js

@@ -141,8 +141,8 @@ export default {
   proxy: {
     '/api': {
       // target: 'http://192.168.20.152:8888/',
-      // target: 'http://120.55.44.4:8896/',
-      target: 'http://47.96.12.136:8896/',
+      target: 'http://120.55.44.4:8896/',
+      // target: 'http://47.96.12.136:8896/',
       // target: 'http://oraysmart.com:8889/',
       // target: 'http://oraysmart.com:8888/api',
       // changeOrigin: true,

+ 2 - 1
src/pages/Detail/LuckySheet.js

@@ -103,7 +103,8 @@ class LuckySheet extends React.Component {
         templateId: templateId,
         // flowId: version.flow_id,
         loadUrl: `/api/v1/purchase/record/sheet?gridKey=${version.id}&JWT-TOKEN=${token}`,
-        updateUrl: `ws://47.96.12.136:8896/api/v1/ws?id=${version.id}&sid=${templateId}&JWT-TOKEN=${token}`,
+        updateUrl: `ws://${location.host}/api/v1/ws?id=${version.id}&sid=${templateId}&JWT-TOKEN=${token}`,
+        // updateUrl: `ws://120.55.44.4:8896/api/v1/ws?id=${version.id}&sid=${templateId}&JWT-TOKEN=${token}`,
         authorityUrl: `/api/v1/purchase/bom/user/excel/col?depId=${localStorage.depId}&JWT-TOKEN=${token}`,
         getUser,
         // workbookCreateBefore(luckysheet) {

+ 0 - 2
src/utils/utils.js

@@ -198,12 +198,10 @@ export const importCDN = (url, name) =>
   });
 
 export const clearToken = () => {
-  debugger
   localStorage.setItem('JWT-TOKEN', '');
 };
 
 export const storeToken = token => {
-  debugger
   localStorage.setItem('JWT-TOKEN', token);
 };