- 新增 utils/env,用 wx.getAccountInfoSync().miniProgram.envVersion 识别 develop/trial/release - request 与 lefu 的地址由硬编码改为按环境映射,develop/trial 走测试网关,release 走正式网关 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
26 lines
763 B
TypeScript
26 lines
763 B
TypeScript
import type { LeFuConfig } from './types'
|
|
import { ENV, type EnvType } from '../utils/env/index'
|
|
|
|
/** 各环境配网网关地址:develop / trial 走测试网关,release 走正式网关 */
|
|
const DOMAINS: Record<EnvType, { domain1: string; domain2: string }> = {
|
|
develop: {
|
|
domain1: 'http://10.10.10.10:8889',
|
|
domain2: 'http://10.10.10.10:8889/weight',
|
|
},
|
|
trial: {
|
|
domain1: 'http://10.10.10.10:8889',
|
|
domain2: 'http://10.10.10.10:8889/weight',
|
|
},
|
|
release: {
|
|
domain1: 'http://device.shuziweidao.com:80/gateway',
|
|
domain2: 'http://device.shuziweidao.com:80/weight',
|
|
},
|
|
}
|
|
|
|
/** 乐福 SDK 配置 */
|
|
export const LEFU_CONFIG: LeFuConfig = {
|
|
key: 'lefudc91611833e18d94',
|
|
secret: 'eQ50JYimMp0X7uhNLj6D3lTEk4TUUvEG7dvaqKM9t1U=',
|
|
...DOMAINS[ENV],
|
|
}
|