diff --git a/frontend/src/api/dingtalk.ts b/frontend/src/api/dingtalk.ts index 7d5ff5c..86ae837 100644 --- a/frontend/src/api/dingtalk.ts +++ b/frontend/src/api/dingtalk.ts @@ -1,4 +1,5 @@ import request from '@/utils/request' +import axios from 'axios' import type { Result } from '@/api/types' // 钉钉配置接口类型 @@ -69,8 +70,13 @@ export function getDingTalkDepartments(): Promise { * 同步钉钉部门 */ export function syncDingTalkDepartments(): Promise { - return request.post>('/dingtalk/sync-departments') - .then(res => res.data) + // 同步部门操作可能需要较长时间,设置超时时间为60秒 + const token = localStorage.getItem('token') + return axios.post>('/api/dingtalk/sync-departments', {}, { + timeout: 60000, + headers: token ? { 'Authorization': `Bearer ${token}` } : {} + }) + .then(res => res.data.data) } /**