有效期改成 30 天
This commit is contained in:
@@ -49,6 +49,15 @@ test('resolveKuaishouIndustryVoucherValidity uses certExpDays when explicit time
|
|||||||
assert.equal(validity.validEndTime, nowMs + 3 * 86_400_000)
|
assert.equal(validity.validEndTime, nowMs + 3 * 86_400_000)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('resolveKuaishouIndustryVoucherValidity defaults to thirty days', () => {
|
||||||
|
const nowMs = 1783394218325
|
||||||
|
const validity = resolveKuaishouIndustryVoucherValidity({}, nowMs)
|
||||||
|
|
||||||
|
assert.equal(validity.validStartTime, nowMs)
|
||||||
|
assert.equal(validity.validEndTime, nowMs + 30 * 86_400_000)
|
||||||
|
assert.equal(validity.certExpDays, 30)
|
||||||
|
})
|
||||||
|
|
||||||
test('resolveKuaishouIndustryVoucherValidity prefers actual certificate time range', () => {
|
test('resolveKuaishouIndustryVoucherValidity prefers actual certificate time range', () => {
|
||||||
const validity = resolveKuaishouIndustryVoucherValidity(
|
const validity = resolveKuaishouIndustryVoucherValidity(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { consumeCallback } from './consume-callback-service.js'
|
|||||||
import { destroyCallback } from './destroy-callback-service.js'
|
import { destroyCallback } from './destroy-callback-service.js'
|
||||||
import type { KuaishouIndustryVoucherRow, TaskRow } from '../../../types/repository/rows.js'
|
import type { KuaishouIndustryVoucherRow, TaskRow } from '../../../types/repository/rows.js'
|
||||||
|
|
||||||
export const KUAISHOU_INDUSTRY_DEFAULT_VALID_DAYS = 3
|
export const KUAISHOU_INDUSTRY_DEFAULT_VALID_DAYS = 30
|
||||||
export const KUAISHOU_INDUSTRY_SEND_CALLBACK_STATUS = {
|
export const KUAISHOU_INDUSTRY_SEND_CALLBACK_STATUS = {
|
||||||
PENDING: 'pending',
|
PENDING: 'pending',
|
||||||
SUCCESS: 'success',
|
SUCCESS: 'success',
|
||||||
|
|||||||
@@ -467,7 +467,7 @@ validEndTime:
|
|||||||
4. 当前时间 + certExpDays * 86400000
|
4. 当前时间 + certExpDays * 86400000
|
||||||
```
|
```
|
||||||
|
|
||||||
如果 `certExpDays` 也为空,则使用保守默认值,例如 3 天。
|
如果 `certExpDays` 也为空,则使用默认值 30 天。
|
||||||
|
|
||||||
对于上面的真实请求,返回给快手的电子凭证应类似:
|
对于上面的真实请求,返回给快手的电子凭证应类似:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user