@@ -2,7 +2,7 @@
"miniprogramRoot": "./dist",
"projectname": "mini",
"description": "",
- "appid": "wx224c7b7d5e4ed130",
+ "appid": "wxaa39f39d574805a5",
"setting": {
"urlCheck": false,
"es6": false,
@@ -43,6 +43,8 @@ const app = new OpenAPIHono()
// 获取微信支付回调头信息
const headers = {
+ // 开发环境配置成 租户2 'X-Tenant-Id': '2'
+ 'X-Tenant-Id': c.req.header('X-Tenant-Id') || '2',
'wechatpay-timestamp': c.req.header('wechatpay-timestamp') || '',
'wechatpay-nonce': c.req.header('wechatpay-nonce') || '',
'wechatpay-signature': c.req.header('wechatpay-signature') || '',
@@ -311,7 +311,7 @@ export class PaymentMtService extends GenericCrudService<PaymentMtEntity> {
// 重新初始化微信支付SDK(先初始化以进行签名验证和解密)
console.debug(`开始初始化微信支付SDK`);
- await this.initializeWxPay(1); // 先使用默认租户ID进行初始化
+ await this.initializeWxPay(headers['X-Tenant-Id']); // 使用从域名代理中配置的header中的租户id
console.debug(`微信支付SDK初始化完成`);
// 验证回调签名
@@ -88,7 +88,12 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
username,
password
}
- })
+ },
+ import.meta.env.DEV ? {
+ headers: {
+ 'X-Tenant-Id': '2'
+ }
+ }: undefined )
if (response.status !== 200) {
const result = await response.json()
throw new Error(result.message);