统一领取流:Step1 填 UID,按平台分叉履约
领取页改为统一 UID 入口;lewan 强制角色 ID 匹配后才发货核销,feifei 将 uid 拼入 H5 并去掉 claim 短链,对外仍返回本站 claimUrl。
This commit is contained in:
@@ -4,6 +4,7 @@ import assert from 'node:assert/strict'
|
||||
import {
|
||||
buildFeifeiPlatformOrderNo,
|
||||
resolveKuaishouFeifeiClaimUrl,
|
||||
resolveKuaishouFeifeiH5UrlWithUid,
|
||||
resolveKuaishouFeifeiPlatformAmount,
|
||||
} from './index.js'
|
||||
import type { TaskRow } from '../../../types/repository/rows.js'
|
||||
@@ -31,7 +32,7 @@ test('resolveKuaishouFeifeiClaimUrl does not expose local claim token fallback',
|
||||
)
|
||||
})
|
||||
|
||||
test('resolveKuaishouFeifeiClaimUrl prefers internal short link', () => {
|
||||
test('resolveKuaishouFeifeiClaimUrl prefers direct h5 over historical short link url', () => {
|
||||
assert.equal(
|
||||
resolveKuaishouFeifeiClaimUrl({
|
||||
shortLink: {
|
||||
@@ -43,10 +44,24 @@ test('resolveKuaishouFeifeiClaimUrl prefers internal short link', () => {
|
||||
rechargeUrl: 'https://feifei.example.com/h5/bind?code=very-long',
|
||||
},
|
||||
}),
|
||||
'https://ks.khhao.com/s/AbCd1234',
|
||||
'https://feifei.example.com/h5/bind?code=very-long',
|
||||
)
|
||||
})
|
||||
|
||||
test('resolveKuaishouFeifeiH5UrlWithUid appends uid query', () => {
|
||||
const next = resolveKuaishouFeifeiH5UrlWithUid(
|
||||
{
|
||||
h5: {
|
||||
rechargeUrl: 'http://skin-exchange.yiquyou.icu/h5/bind?code=eyJpdi&product_name=demo',
|
||||
},
|
||||
},
|
||||
'166909256',
|
||||
)
|
||||
const url = new URL(next)
|
||||
assert.equal(url.searchParams.get('uid'), '166909256')
|
||||
assert.equal(url.searchParams.get('code'), 'eyJpdi')
|
||||
})
|
||||
|
||||
test('buildFeifeiPlatformOrderNo prefers source order number', () => {
|
||||
assert.equal(
|
||||
buildFeifeiPlatformOrderNo(createTask({
|
||||
|
||||
Reference in New Issue
Block a user