调整(虎牙客户资料): 增加游戏主页截图、UID 纯数字与角色名混入校验
- 迁移 191:semi_auto_tasks 增加客户游戏主页截图 5 个正式字段
(object_key / url / thumbnail_url / filename / uploaded_at)。
- 新增 POST /customer-fulfillment/:orderNo/tasks/:taskId/homepage-screenshot
(writeLimit + 单文件上传),场景 semi-auto-homepage-screenshot、
归属 semi-auto-task-{taskId},与斗鱼同一套 file_assets 校验口径。
- 保存资料改为四要素必填:区服 / 游戏角色 UID / 角色名 / 游戏主页截图;
截图须在同一事务内校验归属与类型,缺失或越权直接 400。
- 游戏角色 UID 改为 1..20 位纯数字校验(semi_auto_profile_role_id_invalid);
角色名新增「不得混入 UID/区服/登录方式」校验,规则与斗鱼一致并在后端再实现一份。
- 客户页:UID 提示改为「请输入游戏角色 UID,纯数字uid」、只接受数字输入并实时提示;
角色名加斗鱼同款提示与混入警告;新增「游戏主页截图(必填)」上传区 + 示例图 + 说明文案;
已保存截图按 DTO 的 objectKey 回填预览,不再从文件链接反解。
- 角色名规则收敛到共享 game-role-name(删除 douyu-role-name 转发层,斗鱼页面与文案不变)。
- 「资料已完成」判断仍只看已保存三要素:截图在保存时强制,
避免本次改造前已填好资料的历史任务被卡回第一步。
- 权威文档同步虎牙资料四要素、UID 纯数字、角色名混入校验与截图用途,并补迁移 191 记录。
This commit is contained in:
@@ -53,18 +53,22 @@ test('虎牙客户页固定先填写资料,再登录并绑定角色', () => {
|
||||
assert.ok(source.includes('(isWeibo || profileComplete) &&'))
|
||||
})
|
||||
|
||||
test('资料完整要求区服、角色名和 UID,但 UID 不做格式校验', () => {
|
||||
test('资料完整只判断已保存的三要素,截图由提交校验强制', () => {
|
||||
const profileStart = source.indexOf('const profileComplete = Boolean(')
|
||||
const profileEnd = source.indexOf('\n\n const load =', profileStart)
|
||||
const profileSource = source.slice(profileStart, profileEnd)
|
||||
assert.ok(profileSource.includes('customerServerZone'))
|
||||
assert.ok(profileSource.includes('customerGameRoleId'))
|
||||
assert.ok(profileSource.includes('customerGameRoleName'))
|
||||
assert.ok(source.includes('请完整填写区服、游戏角色 UID 和角色名'))
|
||||
// 截图是保存时的必填项,但不能当「资料已完成」门禁,否则老任务会被卡回第一步。
|
||||
assert.ok(!profileSource.includes('homepageScreenshotUrl'))
|
||||
// 必填与格式校验统一收敛到纯函数,页面只负责展示提示。
|
||||
assert.ok(source.includes('validateCustomerProfileSubmit({'))
|
||||
assert.ok(source.includes('UID 只做资料留档,不参与绑定核验'))
|
||||
assert.ok(source.includes('游戏角色 UID <span>*</span>'))
|
||||
assert.ok(!source.includes('游戏角色 UID 只能是数字'))
|
||||
assert.ok(!source.includes('!/^\\d+$/.test(profileRoleId.trim())'))
|
||||
assert.ok(source.includes('游戏主页截图 <span>*</span>'))
|
||||
assert.ok(source.includes("event.target.value.replace(/\\D/g, '')"))
|
||||
assert.ok(source.includes('maxLength={20}'))
|
||||
})
|
||||
|
||||
test('登录和绑定专用同步阶段暂停整单轮询', () => {
|
||||
|
||||
Reference in New Issue
Block a user