[ { "file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts", "pat": "return role === 'admin';", "repl": "return role !== undefined && role.trim().toLowerCase() === 'admin';", "test": "admin", "why": "角色判定放宽" }, { "file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts", "pat": " if \\(!found\\) \\{\n out\\.push\\(item\\);\n \\}\n return out;", "repl": " if (!found) {\n list.push(item);\n }\n return list;", "test": "admin", "why": "toggled 就地改入参" }, { "file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts", "pat": "if \\(v === undefined \\|\\| v\\.length === 0\\) \\{", "repl": "if (v === undefined) {", "test": "admin", "why": "空串不当从未登录" }, { "file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts", "pat": " if \\(user\\.role === 'admin'\\) \\{\n return false;\n \\}\n", "repl": "", "test": "admin", "why": "管理员也打受限徽标" }, { "file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts", "pat": "return '操作失败(服务端没有给原因)';", "repl": "return '操作失败';", "test": "admin", "why": "兜底句不说原因缺席" }, { "file": "client/harmony/entry/src/main/ets/model/AdminUsers.ts", "pat": " return message;\n \\}\n if \\(!isApiError", "repl": " return '操作失败';\n }\n if (!isApiError", "test": "admin", "why": "吞掉服务端文案" }, { "file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts", "pat": "const longest: number = Math\\.max\\(width, height\\);", "repl": "const longest: number = width;", "test": "prep", "why": "缩放按宽算" }, { "file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts", "pat": "const scale: number = Math\\.min\\(1, maxEdge / longest\\);", "repl": "const scale: number = maxEdge / longest;", "test": "prep", "why": "小图被放大" }, { "file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts", "pat": "second\\.maxEdge = RETRY_EDGE;", "repl": "second.maxEdge = MAX_EDGE;", "test": "prep", "why": "退档不降分辨率" }, { "file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts", "pat": "second\\.quality = RETRY_QUALITY;", "repl": "second.quality = FIRST_QUALITY;", "test": "prep", "why": "退档不降质量" }, { "file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts", "pat": "return actualBytes > MAX_UPLOAD_BYTES;", "repl": "return actualBytes >= MAX_UPLOAD_BYTES;", "test": "prep", "why": "等于上限也退档" }, { "file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts", "pat": "if \\(sizeBytes > MAX_SOURCE_BYTES\\) \\{", "repl": "if (sizeBytes >= MAX_SOURCE_BYTES) {", "test": "prep", "why": "边界 >= 而不是 >" }, { "file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts", "pat": "if \\(!mimeType\\.startsWith\\('image/'\\)\\) \\{", "repl": "if (false) {", "test": "prep", "why": "不判类型" }, { "file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts", "pat": "return '上传失败:' \\+ serverMessage;", "repl": "return '上传失败';", "test": "prep", "why": "吞掉上传失败文案" }, { "file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts", "pat": "export const MAX_UPLOAD_BYTES: number = 3_670_016;", "repl": "export const MAX_UPLOAD_BYTES: number = 6_291_456;", "test": "prep", "why": "上限超过服务端 4MiB" }, { "file": "client/harmony/entry/src/main/ets/model/ImagePrep.ts", "pat": "export const MAX_EDGE: number = 2560;", "repl": "export const MAX_EDGE: number = 4096;", "test": "prep", "why": "首档最长边改 4096" }, { "file": "client/harmony/entry/src/main/ets/pages/AdminUsersPage.ets", "pat": " if \\(isRestricted\\(user\\)\\) \\{", "repl": " if (false) {", "test": "admin", "why": "去掉受限徽标" }, { "file": "client/harmony/entry/src/main/ets/pages/AdminUsersPage.ets", "pat": " onlyStatus\\.status = 'active';", "repl": " onlyStatus.status = 'active';\n onlyStatus.display_name = this.editDisplayName;", "test": "admin", "why": "启停顺带发 display_name" }, { "file": "client/harmony/entry/src/main/ets/pages/AdminUsersPage.ets", "pat": " \\.backgroundColor\\(Theme\\.surface\\)\n \\.borderRadius\\(Theme\\.radiusCard\\)\n \\.onClick\\(\\(\\) => \\{ this\\.toggleEdit\\(user\\); \\}\\)", "repl": " .backgroundColor('#123456')\n .onClick(() => { this.toggleEdit(user); })", "test": "admin", "why": "写死色值 + 去卡片圆角" }, { "file": "client/harmony/entry/src/main/ets/pages/SettingsPage.ets", "pat": " this\\.isAdmin = false;\n \\}", "repl": " this.isAdmin = true;\n }", "test": "admin", "why": "身份读不到时乐观显示入口" }, { "file": "client/harmony/entry/src/main/ets/pages/SettingsPage.ets", "pat": " if \\(this\\.isAdmin\\) \\{", "repl": " if (true) {", "test": "admin", "why": "管理入口不做门禁" }, { "file": "client/harmony/entry/src/main/ets/pages/SettingsPage.ets", "pat": " @State isAdmin: boolean = false;", "repl": " @State isAdmin: boolean = true;", "test": "admin", "why": "isAdmin 初值 true" }, { "file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets", "pat": "if \\(!overLimit\\) \\{\n\\s*break;", "repl": "if (true) {\n break;", "test": "prep", "why": "永远只压第一档" }, { "file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets", "pat": "if \\(packed === null \\|\\| overLimit\\)", "repl": "if (packed === null)", "test": "prep", "why": "两档都超限不拒绝" }, { "file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets", "pat": "overLimit = shouldRetryWithActual\\(usedBytes\\);", "repl": "overLimit = false;", "test": "prep", "why": "结论恒 false" }, { "file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets", "pat": "await packer\\.release\\(\\);", "repl": "packer.release();", "test": "prep", "why": "packer.release 不 await" }, { "file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets", "pat": "await head\\.release\\(\\);", "repl": "head.release();", "test": "prep", "why": "head.release 不 await" }, { "file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets", "pat": "desiredSize: \\{ width: size\\.width, height: size\\.height \\}", "repl": "desiredSize: { width: info.size.width, height: info.size.height }", "test": "prep", "why": "按原图尺寸解码" }, { "file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets", "pat": " quality: Math\\.round\\(quality \\* 100\\)", "repl": " quality: quality", "test": "prep", "why": "quality 不换算" }, { "file": "client/harmony/entry/src/main/ets/common/BackgroundPicker.ets", "pat": " this\\.onUploaded\\(UPLOAD_OK_HINT\\);", "repl": " this.bgKind = 'image';", "test": "prep", "why": "组件自己宣布成功" }, { "file": "client/harmony/entry/src/main/ets/api/ApiClient.ets", "pat": "name: 'file',\n contentType: mimeType", "repl": "name: 'image',", "test": "prep", "why": "multipart 字段名不是 file(uploadBytes 那一处;此前锚点命中 2 次跑不起来,已切片)" }, { "file": "client/harmony/entry/src/main/ets/api/AppearanceApi.ets", "pat": "fileName, 'image/jpeg'\\);", "repl": "fileName, 'application/octet-stream');", "test": "prep", "why": "上传 mime 发错" }, { "file": "client/harmony/entry/src/main/ets/pages/SettingsPage.ets", "pat": " await store\\.syncFromServer\\(ctx, client\\);\n this\\.adoptSnapshot\\(store\\.current\\(\\), store\\.statusText\\(\\)\\);\n \\}\n\n /\\*\\* 把 store 里的快照复制进 @State", "repl": " this.bgKind = 'image';\n }\n\n /** 把 store 里的快照复制进 @State", "test": "prep", "why": "上传成功后不重新同步" } ]