fix: 修复图片上传字段语义颠倒及加载缺失鉴权头导致的 403
- 修正 UploadUtil 返回字段到 FileBean 的映射: newName 是原图(较大)、zipFileName 是缩略图(较小) - 保证 bean.pic 存缩略图、bean.originalPic 存原图 - 全局 loadImage BindingAdapter 对 http(s) URL 自动包装 GlideUrl + Authorization,避免 /file/getImg/ 接口 403 - ImageSelectViewHolder 缩略图带鉴权加载,点击预览传原图 - 覆盖国内/国际事故签证、国内进港移库/移交编辑页面 - CLAUDE.md 同步修正 UploadBean 字段语义文档 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -277,8 +277,10 @@ class IntImpAccidentVisaEditViewModel : BaseViewModel(), IOnItemClickListener {
|
||||
.filter { it.path.isNotEmpty() && it.url.isEmpty() }
|
||||
.onEach {
|
||||
val data = UploadUtil.upload(it.path).data
|
||||
it.url = data?.newName ?: ""
|
||||
it.originalPic = data?.zipFileName ?: ""
|
||||
// UploadUtil 返回:newName=原图(较大),zipFileName=缩略图(较小)
|
||||
// FileBean.url 用作缩略图标识,FileBean.originalPic 用作原图标识
|
||||
it.url = data?.zipFileName ?: ""
|
||||
it.originalPic = data?.newName ?: ""
|
||||
}
|
||||
.flowOn(Dispatchers.IO)
|
||||
.onStart { showLoading() }
|
||||
|
||||
Reference in New Issue
Block a user