From 9f6e099c39b61027cc96df77200b98388d48d348 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期四, 16 七月 2026 22:59:49 +0800
Subject: [PATCH] bug fix
---
src/modules/push/controller/app/open.ts | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/modules/push/controller/app/open.ts b/src/modules/push/controller/app/open.ts
index 878a3bd..4e03d09 100644
--- a/src/modules/push/controller/app/open.ts
+++ b/src/modules/push/controller/app/open.ts
@@ -3,16 +3,13 @@
import { PushOpenService } from '../../service/open';
import { WeightUploadDto } from '../../dto/weight.dto';
import * as crypto from 'crypto';
+import { BaseSysParamService } from '../../../base/service/sys/param';
-const CLIENT_ID = '10001';
-const SECRET = '9001ac9676b8';
/**
* 寮�鏀炬棤闇�楠岃瘉鐨勪笂鎶ユ暟鎹帴鍙�
*/
-
-
@CoolController({
prefix: '/open/push',
})
@@ -20,17 +17,26 @@
@Inject()
pushOpenService: PushOpenService;
+ @Inject()
+ baseSysParamService: BaseSysParamService;
+
+
@Post('/weight', { summary: '鍘熷绉伴噸涓婃姤鎺ュ彛' })
async uploadWeight(
@Headers() headers: any,
@Body() data: WeightUploadDto,
) {
+
+ const CLIENT_ID = String(await this.baseSysParamService.dataByKey('YAOHUA.WEIGHT.CLIENTID')); //'10001';
+ const SECRET = String(await this.baseSysParamService.dataByKey('YAOHUA.WEIGHT.SECRET')); '9001ac9676b8';
+
+
const clientId = headers['clientid'];
const sign = headers['sign'];
// 1. clientId 鏍¢獙
if (clientId !== CLIENT_ID) {
- await this.pushOpenService.writePushAuditLog("weight",{ "deviceNo": clientId, "requestContent": data, "errorMessage": "闈炴硶 clientId" });
+ await this.pushOpenService.writePushAuditLog("weight", { "deviceNo": clientId, "requestContent": data, "errorMessage": "闈炴硶 clientId" });
return {
code: 1001,
msg: '闈炴硶 clientId',
@@ -56,7 +62,7 @@
.toLowerCase();
if (realSign !== sign?.toLowerCase()) {
- await this.pushOpenService.writePushAuditLog("weight",{ "deviceNo": data.deviceNo, "requestContent": data, "errorMessage": "绛惧悕楠岃瘉澶辫触" });
+ await this.pushOpenService.writePushAuditLog("weight", { "deviceNo": data.deviceNo, "requestContent": data, "errorMessage": "绛惧悕楠岃瘉澶辫触" });
return {
code: 1002,
@@ -72,7 +78,7 @@
data: 'success',
};
} catch (err) {
- await this.pushOpenService.writePushAuditLog("weight",{ "deviceNo": data.deviceNo, "requestContent": data, "errorMessage": "绯荤粺寮傚父,鍐欏叆澶辫触." });
+ await this.pushOpenService.writePushAuditLog("weight", { "deviceNo": data.deviceNo, "requestContent": data, "errorMessage": "绯荤粺寮傚父,鍐欏叆澶辫触." });
return {
code: 500,
@@ -91,7 +97,7 @@
const result = await this.pushOpenService.receiveCameraGpsMessage(body);
//return this.ok(result);
- return {"messageId":result}
+ return { "messageId": result }
}
}
--
Gitblit v1.9.1