@@ -47,15 +47,21 @@ const AddModelDialog = ({ open, onClose }) => {
4747
4848 // 修改:download 默认从 sessionStorage 读取 token(若传参提供则优先)
4949 // performDownload:收到 token 后直连接口,获取 JSON
50- const performDownload = async ( modelId , tokenFromParam , fromLogin = false ) => {
50+ const performDownload = async (
51+ modelId ,
52+ tokenFromParam ,
53+ fromLogin = false
54+ ) => {
5155 const endpoint = `${ API_BASE_URL } /api/models/download?model_id=${ encodeURIComponent (
5256 modelId
5357 ) } `
5458 const effectiveToken =
5559 tokenFromParam ||
5660 sessionStorage . getItem ( 'model_hub_token' ) ||
5761 localStorage . getItem ( 'io_login_success' )
58- const headers = effectiveToken ? { Authorization : `Bearer ${ effectiveToken } ` } : { }
62+ const headers = effectiveToken
63+ ? { Authorization : `Bearer ${ effectiveToken } ` }
64+ : { }
5965 setLoading ( true )
6066 setErrorMsg ( '' )
6167 try {
@@ -111,11 +117,12 @@ const AddModelDialog = ({ open, onClose }) => {
111117 detailMsg = body . message
112118 }
113119 } catch {
114- console . log ( '' ) ;
115-
120+ console . log ( '' )
116121 }
117122 if ( fromLogin ) {
118- setErrorMsg ( detailMsg || t ( 'launchModel.error.noPermissionAfterLogin' ) )
123+ setErrorMsg (
124+ detailMsg || t ( 'launchModel.error.noPermissionAfterLogin' )
125+ )
119126 return
120127 } else {
121128 setPendingModelId ( modelId )
@@ -252,7 +259,13 @@ const AddModelDialog = ({ open, onClose }) => {
252259 title = "Model Platform Signin"
253260 style = { { width : '100%' , minHeight : 520 , border : 0 } }
254261 />
255- < div style = { { display : 'flex' , justifyContent : 'flex-end' , marginTop : 12 } } >
262+ < div
263+ style = { {
264+ display : 'flex' ,
265+ justifyContent : 'flex-end' ,
266+ marginTop : 12 ,
267+ } }
268+ >
256269 < Button onClick = { ( ) => handleClose ( 'login' ) } disabled = { loading } >
257270 关闭
258271 </ Button >
0 commit comments