cjb 3 тижнів тому
батько
коміт
9b62b453f4

+ 2 - 2
entry/src/main/ets/common/util/request/WmsRequest.ets

@@ -11,9 +11,9 @@ import { printError, printRequest, printResponse, handleRes } from './Helps';
 
 
 // jiaxiaoqiang:这里要改
-//const baseUrl = "http://192.168.1.3:11010/" //chuangke
+const baseUrl = "http://192.168.1.3:11010/" //chuangke
 //const baseUrl = "http://192.168.1.174:8079"//huajing
-const baseUrl = "http://192.168.1.3:8079"//huajing
+//const baseUrl = "http://192.168.1.3:8079"//huajing
 // const baseUrl = "http://192.168.1.4:8079/" //chuangke
 const DEBUG = true //
 

+ 23 - 0
entry/src/main/ets/pages/Menu.ets

@@ -12,6 +12,9 @@ import CommonConstants from '../common/constants/CommonConstants'
 import { getToken, getUserInfo } from '../common/util/request/RequestInstance'
 import {UserInfo} from '../viewmodel/wms/UserInfo'
 import UserAuthModel from '../common/util/UserAuthModel';
+import DictInfo from '../viewmodel/DictInfo'
+import connection from '@ohos.net.connection';
+
 const TAG: string = 'MENU'
 @Entry
 @Component
@@ -119,6 +122,26 @@ struct menu {
     this.loginWms();
     this.connectMQTT();
 
+    // 查询数据字典放到CommonConstants的DICT_DATA变量中
+    let res: DictInfo[] = await WmsRequest.post('/api/v1/sys/dictData/all',)
+    if (res && res.length > 0) {
+      for (const dict of res) {
+        CommonConstants.DICT_DATA.set(dict.dictCode, dict.list)
+      }
+    }
+    try {
+      const netHandle = connection.getDefaultNetSync();
+      if (netHandle) {
+        let connectionProperties = await connection.getConnectionProperties(netHandle)
+        if (connectionProperties && connectionProperties.linkAddresses) {
+          connectionProperties.linkAddresses.forEach((address: connection.LinkAddress, index: number) => {
+            console.info('hhtest', "get address info: " + JSON.stringify(address));
+          })
+        }
+      }
+    } catch (err) {
+      console.log('hhtest', err);
+    }
   }