diff --git a/backend/internal/modules/file/service.go b/backend/internal/modules/file/service.go index af5aff4..52292ec 100644 --- a/backend/internal/modules/file/service.go +++ b/backend/internal/modules/file/service.go @@ -4,6 +4,7 @@ import ( "context" "errors" "mime/multipart" + "net/url" "strings" ) @@ -48,13 +49,13 @@ func (s *Service) Upload(req uploadRequest) (*UploadDTO, error) { if err != nil { return nil, err } - url := "/api/files/object?key=" + key + fileURL := "/api/files/object?key=" + url.QueryEscape(key) if scene == "home-banner" { - url = "/api/public/files/object?key=" + key + fileURL = "/api/public/files/object?key=" + url.QueryEscape(key) } return &UploadDTO{ ObjectKey: key, - URL: url, + URL: fileURL, Filename: req.Header.Filename, ContentType: contentType, Size: req.Header.Size, diff --git a/backend/internal/modules/systemconfig/publish_options.go b/backend/internal/modules/systemconfig/publish_options.go index 7997c3b..89434f8 100644 --- a/backend/internal/modules/systemconfig/publish_options.go +++ b/backend/internal/modules/systemconfig/publish_options.go @@ -36,15 +36,19 @@ func DefaultPublishOptions() PublishOptionsDTO { }, }, { - Key: "operator", - Title: "干员皮肤", + Key: "operatorGold", + Title: "干员金皮", Options: []string{ - "威龙-凌霄戍卫", "红狼-蚀金玫瑰", "露娜-黑天际线", "蛊-能天使午夜邮差", - "骇爪-维什戴尔", "骇爪-水墨云图", "威龙-吴彦祖", "威龙-铁面判官", - "威龙-壮志凌云", "威龙-蛟龙特战队", "蜂医-送葬人", "蜂医-危险物质", - "蜂医-黑鹰坠落", "牧羊人-街头之星", "牧羊人-黑鹰坠落", "乌鲁鲁-黑鹰坠落", - "红狼-黑鹰坠落", "无名-夜鹰", "深蓝-不破誓约", "红狼-电锯惊魂", - "露娜-古墓丽影劳拉", "赛伊德", + "露娜-古墓丽影联动", "蛊-不羁人生", "红狼-电锯惊魂", "露娜-金牌射手", + "牧羊人-街头之星", "蜂医-危险物质", "蜂医-送葬人", "无名-夜鹰", + "威龙-壮志凌云", "威龙-蛟龙特战队", "威龙-铁面判官", "威龙-吴彦祖", + }, + }, + { + Key: "operatorRed", + Title: "干员红皮", + Options: []string{ + "凌霄成卫", "蚀金玫瑰", "水墨云图", "午夜邮差", "天际线", "维什戴尔", }, }, { diff --git a/backend/seeds/dev_orders.sql b/backend/seeds/dev_orders.sql index 65689a3..2fa7eb1 100644 --- a/backend/seeds/dev_orders.sql +++ b/backend/seeds/dev_orders.sql @@ -84,7 +84,8 @@ VALUES ), 'skin_groups', JSON_OBJECT( 'melee', JSON_ARRAY('龙牙', '信条'), - 'operator', JSON_ARRAY('威龙-凌霄戍卫', '红狼-蚀金玫瑰'), + 'operatorGold', JSON_ARRAY(), + 'operatorRed', JSON_ARRAY('凌霄成卫', '蚀金玫瑰'), 'weapon', JSON_ARRAY('M4A1棱镜攻势', 'K416命运') ), 'remark', '部分仓库材料请勿使用,下单后会再次提醒。' @@ -120,7 +121,8 @@ VALUES ), 'skin_groups', JSON_OBJECT( 'melee', JSON_ARRAY('怜悯'), - 'operator', JSON_ARRAY('露娜-黑天际线'), + 'operatorGold', JSON_ARRAY(), + 'operatorRed', JSON_ARRAY('天际线'), 'weapon', JSON_ARRAY('SCAR-H电玩高手') ), 'remark', '' @@ -156,7 +158,8 @@ VALUES ), 'skin_groups', JSON_OBJECT( 'melee', JSON_ARRAY('暗星'), - 'operator', JSON_ARRAY('赛伊德'), + 'operatorGold', JSON_ARRAY(), + 'operatorRed', JSON_ARRAY(), 'weapon', JSON_ARRAY('Vector美杜莎') ), 'remark', '' @@ -193,7 +196,8 @@ VALUES ), 'skin_groups', JSON_OBJECT( 'melee', JSON_ARRAY('坠星者', '处刑者'), - 'operator', JSON_ARRAY('威龙-铁面判官', '红狼-蚀金玫瑰'), + 'operatorGold', JSON_ARRAY('威龙-铁面判官'), + 'operatorRed', JSON_ARRAY('蚀金玫瑰'), 'weapon', JSON_ARRAY('M7棱镜攻势S2', 'KC17-造物纪元') ), 'remark', '高价值账号,需按平台流程交接。' @@ -229,7 +233,8 @@ VALUES ), 'skin_groups', JSON_OBJECT( 'melee', JSON_ARRAY('影锋'), - 'operator', JSON_ARRAY('骇爪-水墨云图'), + 'operatorGold', JSON_ARRAY(), + 'operatorRed', JSON_ARRAY('水墨云图'), 'weapon', JSON_ARRAY('QBZ95王牌之剑', 'AUG气象感应') ), 'remark', 'AWM 子弹赠送,其他消耗品按规则扣费。' @@ -264,7 +269,8 @@ VALUES ), 'skin_groups', JSON_OBJECT( 'melee', JSON_ARRAY('北极星'), - 'operator', JSON_ARRAY('蜂医-送葬人'), + 'operatorGold', JSON_ARRAY('蜂医-送葬人'), + 'operatorRed', JSON_ARRAY(), 'weapon', JSON_ARRAY('MP7电玩高手S2') ), 'remark', '' @@ -300,7 +306,8 @@ VALUES ), 'skin_groups', JSON_OBJECT( 'melee', JSON_ARRAY('赤枭', '黑海'), - 'operator', JSON_ARRAY('威龙-壮志凌云', '蜂医-危险物质'), + 'operatorGold', JSON_ARRAY('威龙-壮志凌云', '蜂医-危险物质'), + 'operatorRed', JSON_ARRAY(), 'weapon', JSON_ARRAY('AS Val悬赏令', 'K416命运', 'AUG气象感应') ), 'remark', '' @@ -337,7 +344,8 @@ VALUES ), 'skin_groups', JSON_OBJECT( 'melee', JSON_ARRAY('电锯惊魂', '处刑者'), - 'operator', JSON_ARRAY('露娜-古墓丽影劳拉', '红狼-电锯惊魂'), + 'operatorGold', JSON_ARRAY('露娜-古墓丽影联动', '红狼-电锯惊魂'), + 'operatorRed', JSON_ARRAY(), 'weapon', JSON_ARRAY('M250电玩高手S2', '腾龙气象感应') ), 'remark', '六级弹赠送数量以下单截图为准。' diff --git a/frontend/src/api/files.ts b/frontend/src/api/files.ts index b5ccb57..4fe9ff6 100644 --- a/frontend/src/api/files.ts +++ b/frontend/src/api/files.ts @@ -41,3 +41,11 @@ export async function fetchAdminFileBlob(key: string) { }) return data } + +export async function fetchFileBlobByURL(fileURL: string) { + const apiPath = fileURL.startsWith('/api/') ? fileURL.slice(4) : fileURL + const { data } = await apiClient.get(apiPath, { + responseType: 'blob', + }) + return data +} diff --git a/frontend/src/views/mobile/MobileListingDetailView.vue b/frontend/src/views/mobile/MobileListingDetailView.vue index 2c0b73f..0bd17d4 100644 --- a/frontend/src/views/mobile/MobileListingDetailView.vue +++ b/frontend/src/views/mobile/MobileListingDetailView.vue @@ -81,6 +81,8 @@ const detailSkinGroups = computed(() => { const titles: Record = { melee: "近战皮肤", operator: "干员皮肤", + operatorGold: "干员金皮", + operatorRed: "干员红皮", weapon: "武器皮肤", }; return Object.entries(groups as Record) diff --git a/frontend/src/views/mobile/MobileSellerListingCreateView.vue b/frontend/src/views/mobile/MobileSellerListingCreateView.vue index 34182b5..bf5299d 100644 --- a/frontend/src/views/mobile/MobileSellerListingCreateView.vue +++ b/frontend/src/views/mobile/MobileSellerListingCreateView.vue @@ -1,9 +1,9 @@