pig flower 3 месяцев назад
Родитель
Сommit
3255842253

+ 22 - 0
webServer/src/channels/handlers/HuaweiChannelHandler.ts

@@ -96,6 +96,17 @@ export class HuaweiChannelHandler implements ChannelHandler {
                 return await meituanHandler.handleLogin(ctx, meituanConfig);
             }
 
+            // platform=tbminiapp 时使用淘宝渠道配置
+            if (platform === 'tbminiapp') {
+                const taobaoConfig = ChannelConfigManager.getConfig(19);
+                if (!taobaoConfig) {
+                    logger.error("淘宝渠道配置不存在");
+                    return { code: -1, msg: "渠道配置错误", data: null };
+                }
+                logger.info("channelId=17, platform=tbminiapp, 使用淘宝渠道配置处理登录");
+                config = taobaoConfig;
+            }
+
             const { token } = data;
 
             // 验证必要参数
@@ -321,6 +332,17 @@ export class HuaweiChannelHandler implements ChannelHandler {
                 return await meituanHandler.handlePayment(ctx, meituanConfig);
             }
 
+            // platform=tbminiapp 时使用淘宝渠道配置
+            if (platform === 'tbminiapp') {
+                const taobaoConfig = ChannelConfigManager.getConfig(19);
+                if (!taobaoConfig) {
+                    logger.error("淘宝渠道配置不存在");
+                    return { code: 1, msg: "渠道配置错误" };
+                }
+                logger.info("channelId=17, platform=tbminiapp, 使用淘宝渠道配置处理支付回调");
+                config = taobaoConfig;
+            }
+
             // 1. 验证必要参数
             const requiredParams = ['app_id', 'user_id', 'server_id', 'role_id', 'cp_order_id', 
                                    'cs_order_no', 'cs_trade_no', 'pay_amount', 'swap_coin_num', 

+ 14 - 1
webServer/src/config/channelConfig.ts

@@ -47,7 +47,7 @@ import {
     HKT_ANDROID_CALLBACK_KEY,
     HKT_IOS_PRODUCT_CODE,
     HKT_IOS_CALLBACK_KEY,
-    HKT_DOMAIN
+    HKT_DOMAIN, TAOBAO_CALLBACK_SECRET, TAOBAO_APP_ID, TAOBAO_APP_SECRET
 } from "./thirdParams";
 
 // 渠道配置接口定义
@@ -321,4 +321,17 @@ export const channelConfigs: Record<number, ChannelConfig> = {
             productCode: HKT_ANDROID_PRODUCT_CODE, // 默认使用安卓的
         },
     },
+    19: {
+        // 淘宝渠道
+        channelId: 17,
+        name: "淘宝",
+        platform: "tbminiapp",
+        paymentConfig: {
+            callbackKey: TAOBAO_CALLBACK_SECRET,
+        },
+        loginConfig: {
+            appId: TAOBAO_APP_ID,
+            appSecret: TAOBAO_APP_SECRET ,
+        },
+    },
 };

+ 1 - 1
webServer/src/config/dbConfig.ts

@@ -1,7 +1,7 @@
 
 export const mysqlConfig = {
     user: "root", //账号
-    password: "wch123.com", //密码
+    password: "wch123.com", //密码 CmASfW98lOKbFieqEQox wch123.com
     database: "sdk", //数据库
     host: "127.0.0.1", //服务器地址
     port: 3306, //数据库端口

+ 5 - 0
webServer/src/config/thirdParams.ts

@@ -135,6 +135,11 @@ export const MEITUAN_APP_SECRET = "e56ebfd0ac5d47911aea3d6b55383b32c710a83415db4
 export const HUAWEI_APP_ID = "251208633431"; // 需要配置实际的传盛应用ID
 export const HUAWEI_APP_SECRET = "7B04DC515110A88336FD3DEDBF650F3F"; // 需要配置实际的应用密钥
 export const HUAWEI_CALLBACK_SECRET = "55B5E96B295F07BB858FE7D90018AEAB"; // 需要配置实际的回调密钥(用于支付回调签名验证)
+// 淘宝渠道
+export const TAOBAO_APP_ID = "251225994751"; // 需要配置实际的传盛应用ID
+export const TAOBAO_APP_SECRET = "7C664178FAAEE2711FFA2C1A13D5B608"; // 需要配置实际的应用密钥
+export const TAOBAO_CALLBACK_SECRET = "7A4B128D8F8035AED1372CB45EBF0E08"; // 需要配置实际的回调密钥(用于支付回调签名验证)
+
 
 // 港台渠道(Quick海外SDK)
 // 安卓配置

+ 3 - 0
webServer/src/controller/ApiController.ts

@@ -1092,6 +1092,9 @@ class ApiController {
                 "gf300",
                 "YDKL888",
                 "SDKL888",
+                "CHUXILB",
+                "CHUNJIELB",
+                "YUANXIAOLB"
             ];
             let param: string = "";
 

+ 1 - 1
webServer/src/server.ts

@@ -23,7 +23,7 @@ let serverManager: ServerManager;
 // 启动服务器
 async function startServer() {
   // 先初始化MongoDB
-  await initializeMongoDB();
+  // await initializeMongoDB();
   
   // 创建服务器管理器实例
   serverManager = new ServerManager(router);