From 9256c0e2da81ba4f903b9f67da80651ec619f2de Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 2 Jan 2026 14:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E5=90=8C=E6=AD=A5=E9=92=89=E9=92=89?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E6=97=B6=E9=97=B4=E5=88=B060=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/dingtalk.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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) } /**