|
|
@@ -161,12 +161,8 @@ function normalizeChannelList(raw: unknown): RemittanceChannel[] {
|
|
|
}
|
|
|
|
|
|
export async function fetchRemittanceChannels(): Promise<RemittanceChannel[]> {
|
|
|
- let raw: unknown;
|
|
|
- try {
|
|
|
- raw = await postRemittance<unknown>("/remit/channel/list", {});
|
|
|
- } catch {
|
|
|
- raw = await postRemittance<unknown>("/remittance/channel/list", {});
|
|
|
- }
|
|
|
+ // 存款通道固定走 remittance 路径,避免误取到提款通道(/remit/channel/list)。
|
|
|
+ const raw = await postRemittance<unknown>("/remittance/channel/list", {});
|
|
|
return normalizeChannelList(raw);
|
|
|
}
|
|
|
|
|
|
@@ -208,10 +204,14 @@ export async function submitXfgPayOrder(input: {
|
|
|
payPhone: string;
|
|
|
}): Promise<{ raw: unknown; resultUrl: string | null }> {
|
|
|
const normalizedRequestUrl = `/${input.requestUrl.replace(/^\/+|\/+$/g, "")}`;
|
|
|
+ // 仍以后端下发 requestUrl 为准(动态);仅当明显是提款路径时兜底,避免误打提款申请。
|
|
|
+ const payRequestPath = /^\/withdraw(\/|$)/i.test(normalizedRequestUrl)
|
|
|
+ ? "/xfgpay/pay"
|
|
|
+ : normalizedRequestUrl;
|
|
|
const amount = String(input.amount);
|
|
|
const path = input.bankCode
|
|
|
- ? `${normalizedRequestUrl}/1/${encodeURIComponent(amount)}/${encodeURIComponent(input.bankCode)}/0`
|
|
|
- : `${normalizedRequestUrl}/1/${encodeURIComponent(amount)}/0`;
|
|
|
+ ? `${payRequestPath}/1/${encodeURIComponent(amount)}/${encodeURIComponent(input.bankCode)}/0`
|
|
|
+ : `${payRequestPath}/1/${encodeURIComponent(amount)}/0`;
|
|
|
const body = {
|
|
|
goodIds: input.goodIds,
|
|
|
payName: input.payName,
|