feat: update getFile function to include application ID for URL retrieval

This commit is contained in:
wxg0103 2025-11-27 17:44:36 +08:00
parent 8c3caa27dd
commit a05335a0b3
2 changed files with 4 additions and 3 deletions

View File

@ -10,8 +10,8 @@ const postImage: (data: any) => Promise<Result<any>> = (data) => {
return post(`${prefix}`, data)
}
const getFile: (params: any) => Promise<Result<any>> = (params) => {
return get(`/oss/get_url` , params)
const getFile: (application_id: string, params: any) => Promise<Result<any>> = (application_id, params) => {
return get(`/oss/get_url/${application_id}`, params)
}
export default {
postImage,

View File

@ -1237,7 +1237,8 @@ async function saveUrl() {
// URL
async function processUrl(url: string) {
try {
const res = await imageApi.getFile({url});
const appId = props.appId || props.applicationDetails?.id;
const res = await imageApi.getFile(appId, {url});
if (!res.data) {
MsgWarning(url + ' ' + t('chat.uploadFile.invalidUrl'));
return;