Files
dukang/server/dukang-api/src/modules/common/client-config.controller.ts
T
jacy 797b20979d feat(mini-user): v3.5.10 同城配送提示可配置并支持换行
承运商 HTML 按收货市下发;textarea 回车在 C 端转成换行。含门店去掉分享按钮与小程序企微客服。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 14:29:48 +08:00

50 lines
1.9 KiB
TypeScript

import { Controller, Get } from '@nestjs/common';
import {
parseMiniHomeBanners,
resolveClientBrandRuntime,
resolveMiniShareRuntime,
} from '@dukang/shared-types';
import { SystemConfigService } from '../../common/system-config/system-config.service';
@Controller('common')
export class ClientConfigController {
constructor(private readonly systemConfig: SystemConfigService) {}
@Get('client-config')
clientConfig() {
const cfg = this.systemConfig.getAppConfig();
const env = this.systemConfig.getMergedEnv();
const footer = (env.MINI_HOME_FOOTER_URL ?? '').trim();
const minClientVersion = (env.MINI_USER_MIN_VERSION ?? '').trim() || null;
const brand = resolveClientBrandRuntime(env);
const share = resolveMiniShareRuntime(env);
return {
mockPay: cfg.mockPay,
wechatPayEnabled: cfg.wechatPayEnabled,
mockSms: cfg.mockSms,
mockWechat: cfg.mockWechat,
wxAuthorize: cfg.wxAuthorize,
/** 可选暴露;选点已改为服务端 /common/lbs,前端可不依赖此字段 */
tencentLbsKey: cfg.tencentLbsKey || undefined,
minClientVersion,
miniHome: {
banners: parseMiniHomeBanners(env.MINI_HOME_BANNERS),
footerUrl: footer || null,
},
userH5Url: brand.userH5Url,
brandLogoUrl: brand.brandLogoUrl,
brandLogoWideUrl: brand.brandLogoWideUrl,
brandLogoMarkUrl: brand.brandLogoMarkUrl,
qualificationDisclosureUrl: brand.qualificationDisclosureUrl,
customerServicePhone: brand.customerServicePhone,
customerServiceWecomUrl: brand.customerServiceWecomUrl || null,
wecomCorpId: brand.wecomCorpId || null,
partnerOnboardCsQrUrl: (env.PARTNER_ONBOARD_CS_QR_URL ?? '').trim() || null,
partnerOnboardCsHint:
(env.PARTNER_ONBOARD_CS_HINT ?? '').trim() ||
'使用问题、提现问题等随时可联系【杜康好客】客服',
share,
};
}
}