为同步钉钉部门接口增加超时时间到60秒
This commit is contained in:
parent
aa0edbf778
commit
9256c0e2da
@ -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)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user