fix(app): Segment/@Prop 响应式修复 + 相册选择超时 120s + 换装 500 纯文本 body 友好提示
- Segment.selected 改 @Prop:发型页性别分段高亮不跟手(父层刷新不同步) - FormRow value/errorText 改 @Prop:诊断表单选择器行文案不回填(真机复测通过) - SELECT_TIMEOUT_MS 60s→120s:相册选择器冷启动超时后系统浮层成孤儿,点击全失效 - changeCloth 非 JSON body(服务端 500 Internal Server Error)→『服务繁忙,请稍后重试』 - 真机验证:换装请求链路 OK(cloth post 390KB/打点齐全);服务端 GPU(ComfyUI 正式+备份)当前宕机,生成结果待服务恢复后复验
This commit is contained in:
@@ -10,7 +10,7 @@ import { COLOR_PRIMARY, COLOR_IMAGE_BG, COLOR_TEXT_PRIMARY } from '../../core/Th
|
||||
@Component
|
||||
export struct Segment {
|
||||
items: string[] = []
|
||||
selected: number = 0
|
||||
@Prop selected: number = 0
|
||||
onSelect: (idx: number) => void = (_idx: number) => {}
|
||||
|
||||
build() {
|
||||
|
||||
@@ -41,7 +41,7 @@ const LONG_EDGE: number = 1600
|
||||
const JPEG_QUALITY: number = 85
|
||||
const IMG_DOMAIN: number = 0x0001
|
||||
const IMG_TAG: string = 'MEIDA_IMG'
|
||||
const SELECT_TIMEOUT_MS: number = 60000 // 相册选图兜底:系统弹窗最多等 60s
|
||||
const SELECT_TIMEOUT_MS: number = 120000 // 相册选图兜底:冷启动+用户浏览常超 60s(超时后系统浮层成孤儿,点击全失效)
|
||||
const CAMERA_TIMEOUT_MS: number = 120000 // 拍照兜底:给足取景与确认时间
|
||||
|
||||
export class ImageCodec {
|
||||
|
||||
@@ -181,7 +181,13 @@ export class TryonApi {
|
||||
const respText: string = (resp.result ?? '') as string
|
||||
hilog.info(TRYON_DOMAIN, TRYON_TAG, 'cloth resp code=%{public}d body=%{public}s',
|
||||
resp.responseCode, respText.substring(0, 300))
|
||||
const wire = JSON.parse(respText) as ChangeClothWire
|
||||
let wire: ChangeClothWire
|
||||
try {
|
||||
wire = JSON.parse(respText) as ChangeClothWire
|
||||
} catch (_p) {
|
||||
// 服务端 500 等会回纯文本 body(如 "Internal Server Error"):按服务繁忙口径提示
|
||||
throw new ApiError(50000, '服务繁忙,请稍后重试', '换装服务暂时不可用')
|
||||
}
|
||||
if (wire.ret === 0 && wire.data !== undefined && wire.data.length > 0) {
|
||||
return wire.data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user