@@ -9,7 +9,7 @@ import type {
99} from '@/api/type/model'
1010import type { FormField } from '@/components/dynamics-form/type'
1111
12- const prefix = '/system/shared'
12+ const prefix = '/system/shared/model '
1313
1414/**
1515 * 获得模型列表
@@ -19,7 +19,7 @@ const getModel: (
1919 request ?: ListModelRequest ,
2020 loading ?: Ref < boolean > ,
2121) => Promise < Result < Array < Model > > > = ( data , loading ) => {
22- return get ( `${ prefix } /model ` , data , loading )
22+ return get ( `${ prefix } ` , data , loading )
2323}
2424
2525/**
@@ -32,7 +32,7 @@ const getModelParamsForm: (
3232 model_id : string ,
3333 loading ?: Ref < boolean > ,
3434) => Promise < Result < Array < FormField > > > = ( model_id , loading ) => {
35- return get ( `${ prefix } /model/ ${ model_id } /model_params_form` , { } , loading )
35+ return get ( `${ prefix } /${ model_id } /model_params_form` , { } , loading )
3636}
3737
3838/**
@@ -45,7 +45,7 @@ const createModel: (
4545 request : CreateModelRequest ,
4646 loading ?: Ref < boolean > ,
4747) => Promise < Result < Model > > = ( request , loading ) => {
48- return post ( `${ prefix } /model ` , request , { } , loading )
48+ return post ( `${ prefix } ` , request , { } , loading )
4949}
5050
5151/**
@@ -59,7 +59,7 @@ const updateModel: (
5959 request : EditModelRequest ,
6060 loading ?: Ref < boolean > ,
6161) => Promise < Result < Model > > = ( model_id , request , loading ) => {
62- return put ( `${ prefix } /model/ ${ model_id } ` , request , { } , loading )
62+ return put ( `${ prefix } /${ model_id } ` , request , { } , loading )
6363}
6464
6565/**
@@ -73,7 +73,7 @@ const updateModelParamsForm: (
7373 request : any [ ] ,
7474 loading ?: Ref < boolean > ,
7575) => Promise < Result < Model > > = ( model_id , request , loading ) => {
76- return put ( `${ prefix } /model/ ${ model_id } /model_params_form` , request , { } , loading )
76+ return put ( `${ prefix } /${ model_id } /model_params_form` , request , { } , loading )
7777}
7878
7979/**
@@ -86,7 +86,7 @@ const getModelById: (model_id: string, loading?: Ref<boolean>) => Promise<Result
8686 model_id ,
8787 loading ,
8888) => {
89- return get ( `${ prefix } /model/ ${ model_id } ` , { } , loading )
89+ return get ( `${ prefix } /${ model_id } ` , { } , loading )
9090}
9191/**
9292 * 获取模型信息不包括认证信息根据模型id
@@ -98,7 +98,7 @@ const getModelMetaById: (model_id: string, loading?: Ref<boolean>) => Promise<Re
9898 model_id ,
9999 loading ,
100100) => {
101- return get ( `${ prefix } /model/ ${ model_id } /meta` , { } , loading )
101+ return get ( `${ prefix } /${ model_id } /meta` , { } , loading )
102102}
103103/**
104104 * 暂停下载
@@ -110,13 +110,13 @@ const pauseDownload: (model_id: string, loading?: Ref<boolean>) => Promise<Resul
110110 model_id ,
111111 loading ,
112112) => {
113- return put ( `${ prefix } /model/ ${ model_id } /pause_download` , undefined , { } , loading )
113+ return put ( `${ prefix } /${ model_id } /pause_download` , undefined , { } , loading )
114114}
115115const deleteModel : ( model_id : string , loading ?: Ref < boolean > ) => Promise < Result < boolean > > = (
116116 model_id ,
117117 loading ,
118118) => {
119- return del ( `${ prefix } /model/ ${ model_id } ` , undefined , { } , loading )
119+ return del ( `${ prefix } /${ model_id } ` , undefined , { } , loading )
120120}
121121
122122export default {
0 commit comments