为同步钉钉部门接口增加超时时间到60秒

This commit is contained in:
Your Name 2026-01-02 14:11:30 +08:00
parent aa0edbf778
commit 9256c0e2da

View File

@ -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<any[]> {
* 同步钉钉部门
*/
export function syncDingTalkDepartments(): Promise<number> {
return request.post<Result<number>>('/dingtalk/sync-departments')
.then(res => res.data)
// 同步部门操作可能需要较长时间,设置超时时间为60秒
const token = localStorage.getItem('token')
return axios.post<Result<number>>('/api/dingtalk/sync-departments', {}, {
timeout: 60000,
headers: token ? { 'Authorization': `Bearer ${token}` } : {}
})
.then(res => res.data.data)
}
/**