Add create tool page
This commit is contained in:
@@ -109,11 +109,18 @@ service.interceptors.response.use(
|
||||
return response
|
||||
},
|
||||
async (error: AxiosError) => {
|
||||
void message.error(
|
||||
<>
|
||||
<strong>服务器出错</strong>,请稍后重试
|
||||
</>
|
||||
)
|
||||
if (
|
||||
error.code === 'ETIMEDOUT' ||
|
||||
(error.code === 'ECONNABORTED' && error.message.includes('timeout'))
|
||||
) {
|
||||
void message.error('请求超时,请稍后重试')
|
||||
} else {
|
||||
void message.error(
|
||||
<>
|
||||
<strong>服务器出错</strong>,请稍后重试
|
||||
</>
|
||||
)
|
||||
}
|
||||
return await Promise.reject(error?.response?.data)
|
||||
}
|
||||
)
|
||||
|
||||
11
src/services/tool.tsx
Normal file
11
src/services/tool.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from '@/services/index'
|
||||
import { URL_TOOL, URL_TOOL_CATEGORY, URL_TOOL_TEMPLATE } from '@/constants/urls.constants'
|
||||
|
||||
export const r_tool_template_get = () => request.get<ToolTemplateVo[]>(URL_TOOL_TEMPLATE)
|
||||
|
||||
export const r_tool_template_get_one = (id: string) =>
|
||||
request.get<ToolTemplateVo>(`${URL_TOOL_TEMPLATE}/${id}`)
|
||||
|
||||
export const r_tool_category_get = () => request.get<ToolCategoryVo[]>(URL_TOOL_CATEGORY)
|
||||
|
||||
export const r_tool_create = (param: ToolCreateParam) => request.post<ToolVo>(URL_TOOL, param)
|
||||
Reference in New Issue
Block a user