refactor: 优化用户导入和字典数据路由跳转逻辑
移除用户导入接口的deptId参数 使用downloadFile工具函数简化模板下载代码 增加字典数据路由跳转的错误处理
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user