1- import { Result } from '@/request/Result'
2- import { get , post , postStream , del , put , request , download , exportFile } from '@/request/index'
3- import type { pageRequest } from '@/api/type/common'
4- import type { ApplicationFormType } from '@/api/type/application'
5- import { type Ref } from 'vue'
6- import type { FormField } from '@/components/dynamics-form/type'
1+ import { Result } from '@/request/Result'
2+ import { get , post , postStream , del , put , request , download , exportFile } from '@/request/index'
3+ import type { pageRequest } from '@/api/type/common'
4+ import type { ApplicationFormType } from '@/api/type/application'
5+ import { type Ref } from 'vue'
6+ import type { FormField } from '@/components/dynamics-form/type'
77
8- const prefix = '/workspace'
8+ const prefix = '/workspace/' + localStorage . getItem ( 'workspace_id' ) + '/application '
99
1010/**
1111 * 获取全部应用
1212 * @param 参数
1313 */
14- const getAllAppilcation : ( ) => Promise < Result < any [ ] > > = ( ) => {
14+ const getAllApplication : ( ) => Promise < Result < any [ ] > > = ( ) => {
1515 return get ( `${ prefix } ` )
1616}
1717
@@ -22,13 +22,12 @@ const getAllAppilcation: () => Promise<Result<any[]>> = () => {
2222 }
2323 */
2424const getApplication : (
25- wordspace_id : string ,
2625 page : pageRequest ,
2726 param : any ,
2827 loading ?: Ref < boolean > ,
29- ) => Promise < Result < any > > = ( wordspace_id , page , param , loading ) => {
28+ ) => Promise < Result < any > > = ( page , param , loading ) => {
3029 return get (
31- `${ prefix } /${ wordspace_id } /application/ ${ page . current_page } /${ page . page_size } ` ,
30+ `${ prefix } /${ page . current_page } /${ page . page_size } ` ,
3231 param ,
3332 loading ,
3433 )
@@ -39,11 +38,10 @@ const getApplication: (
3938 * @param 参数
4039 */
4140const postApplication : (
42- wordspace_id : string ,
4341 data : ApplicationFormType ,
4442 loading ?: Ref < boolean > ,
45- ) => Promise < Result < any > > = ( wordspace_id , data , loading ) => {
46- return post ( `${ prefix } / ${ wordspace_id } /application ` , data , undefined , loading )
43+ ) => Promise < Result < any > > = ( data , loading ) => {
44+ return post ( `${ prefix } ` , data , undefined , loading )
4745}
4846
4947/**
@@ -131,7 +129,7 @@ const postAppAuthentication: (
131129) => Promise < any > = ( access_token , loading , authentication_value ) => {
132130 return post (
133131 `${ prefix } /authentication` ,
134- { access_token : access_token , authentication_value } ,
132+ { access_token : access_token , authentication_value} ,
135133 undefined ,
136134 loading ,
137135 )
@@ -257,7 +255,7 @@ const getApplicationRerankerModel: (
257255 application_id : string ,
258256 loading ?: Ref < boolean > ,
259257) => Promise < Result < Array < any > > > = ( application_id , loading ) => {
260- return get ( `${ prefix } /${ application_id } /model` , { model_type : 'RERANKER' } , loading )
258+ return get ( `${ prefix } /${ application_id } /model` , { model_type : 'RERANKER' } , loading )
261259}
262260
263261/**
@@ -271,7 +269,7 @@ const getApplicationSTTModel: (
271269 application_id : string ,
272270 loading ?: Ref < boolean > ,
273271) => Promise < Result < Array < any > > > = ( application_id , loading ) => {
274- return get ( `${ prefix } /${ application_id } /model` , { model_type : 'STT' } , loading )
272+ return get ( `${ prefix } /${ application_id } /model` , { model_type : 'STT' } , loading )
275273}
276274
277275/**
@@ -285,21 +283,21 @@ const getApplicationTTSModel: (
285283 application_id : string ,
286284 loading ?: Ref < boolean > ,
287285) => Promise < Result < Array < any > > > = ( application_id , loading ) => {
288- return get ( `${ prefix } /${ application_id } /model` , { model_type : 'TTS' } , loading )
286+ return get ( `${ prefix } /${ application_id } /model` , { model_type : 'TTS' } , loading )
289287}
290288
291289const getApplicationImageModel : (
292290 application_id : string ,
293291 loading ?: Ref < boolean > ,
294292) => Promise < Result < Array < any > > > = ( application_id , loading ) => {
295- return get ( `${ prefix } /${ application_id } /model` , { model_type : 'IMAGE' } , loading )
293+ return get ( `${ prefix } /${ application_id } /model` , { model_type : 'IMAGE' } , loading )
296294}
297295
298296const getApplicationTTIModel : (
299297 application_id : string ,
300298 loading ?: Ref < boolean > ,
301299) => Promise < Result < Array < any > > > = ( application_id , loading ) => {
302- return get ( `${ prefix } /${ application_id } /model` , { model_type : 'TTI' } , loading )
300+ return get ( `${ prefix } /${ application_id } /model` , { model_type : 'TTI' } , loading )
303301}
304302
305303/**
@@ -542,7 +540,7 @@ const importApplication: (data: any, loading?: Ref<boolean>) => Promise<Result<a
542540 return post ( `${ prefix } /import` , data , undefined , loading )
543541}
544542export default {
545- getAllAppilcation,
543+ getAllAppilcation : getAllApplication ,
546544 getApplication,
547545 postApplication,
548546 putApplication,
0 commit comments