修复(斗鱼领取): 未提交游戏主页截图禁止开始绑定

- 领取页以完整客户资料判断是否展示填写表单,避免只有角色名时跳过截图
- 绑定开始接口校验角色/登录方式/系统/截图,缺失返回 409
This commit is contained in:
yml
2026-11-25 10:07:13 +08:00
parent af38bbaddb
commit acc26672f1
2 changed files with 14 additions and 1 deletions
@@ -978,6 +978,12 @@ export async function saveDouyuCustomerProfile(
export async function startDouyuCustomerBinding(orderNo: string, forceRefresh = false) {
let task = await loadTaskByOrderNo(orderNo)
if (!hasDouyuCustomerProfile(task)) {
throw createHttpError('请先提交游戏角色和游戏主页截图,再开始绑定', {
statusCode: 409,
errorCode: 'douyu_customer_profile_required',
})
}
if (!task.live_session_id) {
const session = await ensureLiveSession(task)
task = session.task
@@ -155,7 +155,14 @@ export default function DouyuFulfillmentPage() {
const task = data?.task
const live = data?.live
const needsProfile = Boolean(task && !task.customer_role_name)
const hasCustomerProfile = Boolean(
task?.customer_role_name?.trim() &&
['wechat', 'qq'].includes(task.customer_platform) &&
['ios', 'android'].includes(task.customer_system) &&
task.customer_homepage_screenshot_object_key?.trim() &&
task.customer_homepage_screenshot_url?.trim(),
)
const needsProfile = Boolean(task && !hasCustomerProfile)
const bindingFailed = Boolean(live && BINDING_FAILURE_ISSUES.has(live.issueCode))
const bindingFailureRetryable = Boolean(live?.issueCode === 'binding_failed' && live.accountReady)