This commit is contained in:
xuyue committed 2025-03-07 11:19:25 +08:00
1 parent ebab966207
commit a48ea2cabe
2 files changed
+9 -5

No files matched your search

+2 -1
View File
@@ -64,7 +64,8 @@ export const Account = {
},
async batchCreate(payload: {classname: string, names: string[]}) {
await http.post("/account/batch", payload)
const res = await http.post("/account/batch", payload)
return res.data
}
}
+7 -4
View File
@@ -133,16 +133,19 @@ async function batchCreateUsers() {
if (!names.value.length) return
try {
batchLoading.value = true
await Account.batchCreate({
const data = await Account.batchCreate({
classname: classname.value,
names: names.value,
})
batchLoading.value = false
message.success("批量创建成功")
message.success(data.message)
showBatch.value = false
} catch (err) {
query.page = 1
query.role = ""
init()
} catch (err: any) {
batchLoading.value = false
message.error("有些用户已经存在,创建失败")
message.error(err.detail??"批量创建失败")
}
}