Skip to content

Commit 7a384de

Browse files
fix(modelWarehouse): 初始化的时候调用get请求获取微调模型的list (#9)
* feat(signin): 新增免责声明 * fix(modelWarehouse): 初始化的时候调用get请求获取微调模型的list --------- Co-authored-by: wangbochao.vendor <15830881993@163.com>
1 parent 644c507 commit 7a384de

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

front/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FRONTEND_DEPLOY_STAGE=DEVELOPMENT
22
NEXT_PUBLIC_EDITION=SELF_HOSTED
3-
FRONTEND_CORE_API=http://10.210.0.49:5024/console/api
4-
FRONTEND_APP_API=http://10.210.0.49:5024/api
3+
FRONTEND_CORE_API=http://10.210.0.49:30382/console/api
4+
FRONTEND_APP_API=http://10.210.0.49:30382/api
55

66
# SENTRY
77
NEXT_PUBLIC_SENTRY_DSN=

front/app/(appLayout)/modelWarehouse/modelManage/[id]/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import styles from './index.module.scss'
88
import DrawInfo from './DrawInfo'
99
import AddModal from './AddModal'
1010
import AddModelList from './AddModelList'
11-
import Toast from '@/app/components/base/flash-notice'
11+
import Toast, { ToastTypeEnum } from '@/app/components/base/flash-notice'
1212
import { getModelInfo, reDown } from '@/infrastructure/api/modelWarehouse'
1313
import { deleteModel, getModelList } from '@/infrastructure/api/modelAdjust'
1414
import { useApplicationContext } from '@/shared/hooks/app-context'
@@ -71,10 +71,10 @@ const ModelDetail = (req) => {
7171
const getInfo = () => {
7272
getModelInfo({ url: `mh/model_info/${id}`, options: { params: { qtype, namespace: isMine } } }).then((res) => {
7373
setBaseInfo(res)
74-
if (res?.models?.length > 0) {
74+
if (res?.models?.length > 0)
7575
setType(res?.models[0]?.id)
76-
search.submit()
77-
}
76+
// 初始化时加载微调模型列表
77+
search.submit()
7878
})
7979
}
8080
useEffect(() => {
@@ -83,14 +83,14 @@ const ModelDetail = (req) => {
8383
const handleDelete = async (record) => {
8484
const res = await deleteModel({ url: `/mh/delete_finetune_model/${id}/${record?.id}` })
8585
if (res) {
86-
Toast.notify({ type: 'success', message: '删除成功' })
86+
Toast.notify({ type: ToastTypeEnum.Success, message: '删除成功' })
8787
search.submit()
8888
}
8989
}
9090
const reDownload = () => {
9191
reDown({ url: `/mh/retry_download/${id}` }).then((res) => {
9292
if (res) {
93-
Toast.notify({ type: 'success', message: '操作成功' })
93+
Toast.notify({ type: ToastTypeEnum.Success, message: '操作成功' })
9494
getInfo()
9595
}
9696
})

front/infrastructure/api/modelAdjust.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const getModelListFromFinetune: Fetcher<ModelListResponse, { url: string
1010
}
1111

1212
export const getModelList: Fetcher<BaseResponse, { url: string; body: any }> = ({ url, body }) => {
13-
return post<BaseResponse>(url, { body })
13+
return get<BaseResponse>(url, { params: body })
1414
}
1515

1616
export const getModelListDraw: Fetcher<BaseResponse, { url: string; body: any }> = ({ url, body }) => {

0 commit comments

Comments
 (0)