Skip to content

Commit a05335a

Browse files
committed
feat: update getFile function to include application ID for URL retrieval
1 parent 8c3caa2 commit a05335a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ui/src/api/image.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const postImage: (data: any) => Promise<Result<any>> = (data) => {
1010
return post(`${prefix}`, data)
1111
}
1212

13-
const getFile: (params: any) => Promise<Result<any>> = (params) => {
14-
return get(`/oss/get_url` , params)
13+
const getFile: (application_id: string, params: any) => Promise<Result<any>> = (application_id, params) => {
14+
return get(`/oss/get_url/${application_id}`, params)
1515
}
1616
export default {
1717
postImage,

ui/src/components/ai-chat/component/chat-input-operate/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,8 @@ async function saveUrl() {
12371237
// 异步校验单个 URL
12381238
async function processUrl(url: string) {
12391239
try {
1240-
const res = await imageApi.getFile({url});
1240+
const appId = props.appId || props.applicationDetails?.id;
1241+
const res = await imageApi.getFile(appId, {url});
12411242
if (!res.data) {
12421243
MsgWarning(url + ' ' + t('chat.uploadFile.invalidUrl'));
12431244
return;

0 commit comments

Comments
 (0)