refactor: 优化用户导入和字典数据路由跳转逻辑

移除用户导入接口的deptId参数
使用downloadFile工具函数简化模板下载代码
增加字典数据路由跳转的错误处理
This commit is contained in:
Ray.Hao
2026-03-03 15:16:18 +08:00
parent cee65ba58d
commit 0fd1ff197e
3 changed files with 18 additions and 25 deletions

View File

@@ -133,16 +133,14 @@ const UserAPI = {
/**
* 导入用户
*
* @param deptId 部门ID
* @param file 导入文件
*/
import(deptId: string, file: File) {
import(file: File) {
const formData = new FormData();
formData.append("file", file);
return request<any, ExcelResult>({
url: `${USER_BASE_URL}/import`,
method: "post",
params: { deptId },
data: formData,
headers: {
"Content-Type": "multipart/form-data",