diff --git a/hwe/ts/gateway/admin_member.ts b/hwe/ts/gateway/admin_member.ts index 439ebe69..9af399a8 100644 --- a/hwe/ts/gateway/admin_member.ts +++ b/hwe/ts/gateway/admin_member.ts @@ -7,6 +7,7 @@ import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest'; import { unwrap_any } from '@util/unwrap_any'; import { convertFormData } from '@util/convertFormData'; import { exportWindow } from '@util/exportWindow'; +import { SammoRootAPI } from '@/SammoRootAPI'; import '@/gateway/common'; type UserEntry = { @@ -32,7 +33,7 @@ type UserListResponse = { } const userFrame = '\ -\ +\ <%userID%>\ <%userName%>\ <%emailFunc(email)%>
(<%authType%>)\ @@ -49,6 +50,7 @@ const userFrame = '\ \ \ \ + \ \ \ \ @@ -171,6 +173,25 @@ async function changeSystem(action: string, param?: string): Promise { } } +async function banEmailAddress(target: Element): Promise { + const email: string = $(target).parents('tr').data('email'); + + if (!confirm(`${email}에 대해서 영구차단을 진행합니다.`)) { + return; + } + + const result = await SammoRootAPI.Admin.BanEmailAddress({ + email, + }, true); + + if (!result.result) { + alert(result.reason); + return; + } + + alert('완료되었습니다.'); +} + async function changeUserStatus(action: string, userID: Element | number, param?: number): Promise { if (userID instanceof Element) { userID = parseInt($(userID).parents('tr').data('id')); @@ -180,7 +201,6 @@ async function changeUserStatus(action: string, userID: Element | number, param? return; } - if (action == 'set_userlevel') { if (!isNumber(param)) { param = parseInt(prompt('원하는 등급을 입력해주세요.(1:일반, 4:특별, 5:부운영자, 6:운영자)', '1') ?? '0'); @@ -281,4 +301,5 @@ $(async function () { }); exportWindow(changeSystem, 'changeSystem'); -exportWindow(changeUserStatus, 'changeUserStatus'); \ No newline at end of file +exportWindow(changeUserStatus, 'changeUserStatus'); +exportWindow(banEmailAddress, 'banEmailAddress'); \ No newline at end of file