fix: 修复编辑公告保存失败 — 图片上传逻辑
- uploadImageIfNeeded 增加 notif_ 前缀判断 - 编辑保留原图时不再尝试上传本地文件
This commit is contained in:
@@ -299,8 +299,8 @@ function insertFormat(prefix: string, suffix: string) {
|
||||
/** 上传图片 */
|
||||
async function uploadImageIfNeeded(imageUrl: string): Promise<string> {
|
||||
if (!imageUrl) return ''
|
||||
// 如果已经是完整 URL 或 blob URL,直接返回
|
||||
if (imageUrl.startsWith('http') || imageUrl.startsWith('blob:')) {
|
||||
// 已经是服务器文件名(notif_ 开头)、完整 URL 或 blob URL,直接返回
|
||||
if (imageUrl.startsWith('notif_') || imageUrl.startsWith('http') || imageUrl.startsWith('blob:')) {
|
||||
return imageUrl
|
||||
}
|
||||
// 临时路径需要上传
|
||||
|
||||
Reference in New Issue
Block a user