li.shaoyi 1 tahun lalu
induk
melakukan
7bbfc39d67

+ 1 - 1
app/package.json

@@ -1,6 +1,6 @@
 {
   "name": "trading",
-  "version": "1.0.21",
+  "version": "1.0.7",
   "main": "main.js",
   "dependencies": {
     "electron-updater": "^6.1.4",

+ 2 - 2
oem/sbyj/config/appconfig.json

@@ -1,8 +1,8 @@
 {
   "appId": "com.muchinfo.sbyj",
   "appName": "水贝亿爵",
-  "version": "1.0.4",
-  "versionCode": "100004",
+  "version": "1.0.6",
+  "versionCode": "100006",
   "apiUrl": "http://192.168.31.171:8080/cfg?key=test_171",
   "tradeChannel": "ws",
   "modules": [

+ 5 - 2
src/services/api/goods/index.ts

@@ -1,4 +1,4 @@
-import { getUserId } from '@/services/methods/user'
+import { getUserId, getLoginId } from '@/services/methods/user'
 import { RequestConfig } from '@/services/http/types'
 import http from '@/services/http'
 
@@ -8,7 +8,10 @@ import http from '@/services/http'
 export function queryErmcpGoods(config: RequestConfig<Model.GoodsReq> = {}) {
     return http.commonRequest<Model.GoodsRsp[]>({
         url: '/Ermcp/GetErmcpGoods',
-        params: config.data,
+        params: {
+            loginid: getLoginId(),
+            ...config.data
+        },
     }, 'GetErmcpGoods')
 }
 

+ 15 - 11
src/services/websocket/package/crypto.ts

@@ -194,15 +194,19 @@ export const decryptBody = (base64: string) => {
  * @param encryptData 密文
  * @param size 明文长度
  */
-export const decryptAES = (value: string): string | undefined => {
-    const ciphertext = hexStringToUint8Array(value);
-    const key = hexStringToUint8Array(phoneaeskey);
-
-    const cipherParams = CryptoJS.lib.CipherParams.create({
-        ciphertext: uint8ArrayToWordArray(ciphertext),
-    });
-
-    const decrytped = CryptoJS.AES.decrypt(cipherParams, uint8ArrayToWordArray(key), aesOption);
-    const h = wordArrayToUint8Array(decrytped);
-    return new TextDecoder().decode(h);
+export const decryptAES = (value: string) => {
+    try {
+        const ciphertext = hexStringToUint8Array(value);
+        const key = hexStringToUint8Array(phoneaeskey);
+
+        const cipherParams = CryptoJS.lib.CipherParams.create({
+            ciphertext: uint8ArrayToWordArray(ciphertext),
+        });
+
+        const decrytped = CryptoJS.AES.decrypt(cipherParams, uint8ArrayToWordArray(key), aesOption);
+        const h = wordArrayToUint8Array(decrytped);
+        return new TextDecoder().decode(h);
+    } catch {
+        return ''
+    }
 }

+ 1 - 0
src/types/model/goods.d.ts

@@ -1,6 +1,7 @@
 declare namespace Model {
     /** 查询企业风管期货商品信息 请求 */
     interface GoodsReq {
+        loginid?: number; // 登录账号,传入后会进行有权限的市场过滤结果
         userid?: number; // 用户id(风管云平台版本传值, 只显示用户下设置了套保关联的品种)
         lastUpdateTime?: string; // 最后修改时间 - 闭区间,格式:yyyy-MM-dd HH:mm:ss
     }