fix: del
parent
24a7eeb5e3
commit
d6d86ed657
|
@ -1,4 +1,4 @@
|
|||
import { addSupderAdminAPI } from '@/services/system/supderAdmin';
|
||||
import { addSupderAdminAPI, editSupderAdminAPI } from '@/services/system/supderAdmin';
|
||||
import { ActionType, ProFormRadio, ProFormText } from '@ant-design/pro-components';
|
||||
import { App, Form, Modal } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
@ -24,7 +24,7 @@ const AddSupderAdmin = (props: PropTypes) => {
|
|||
|
||||
const handleAddNewSuperAdmin = async () => {
|
||||
const values = await form.validateFields();
|
||||
const result = await addSupderAdminAPI(values);
|
||||
const result = !editRow?.id ? await addSupderAdminAPI(values) : await editSupderAdminAPI(values);
|
||||
if (result.code === 200) {
|
||||
message.success(`管理员${editRow?.id ? '修改' : '添加'}成功`);
|
||||
handleOnCancel();
|
||||
|
|
|
@ -48,6 +48,12 @@ const Page = () => {
|
|||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updateTime',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '最后登录时间',
|
||||
dataIndex: 'lastLoginTime',
|
||||
|
|
|
@ -11,6 +11,11 @@ export const addSupderAdminAPI = (data: Record<string, any>): Promise<API.Respon
|
|||
return request.post(`/system/superAdmin`, data);
|
||||
};
|
||||
|
||||
export const editSupderAdminAPI = (data: SuperAdmin.SuperAdminItem): Promise<API.ResponstBody> => {
|
||||
delete data.password;
|
||||
return request.put(`/system/superAdmin`, data);
|
||||
};
|
||||
|
||||
export const delSuperAdminAPI = (id: string): Promise<API.ResponstBody> => {
|
||||
return request.delete(`/system/superAdmin/${id}`);
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ declare namespace SuperAdmin {
|
|||
id: string;
|
||||
userName: string;
|
||||
email?: string;
|
||||
password: string;
|
||||
password?: string;
|
||||
phone?: string;
|
||||
picture?: string;
|
||||
isFirstLogin: boolean;
|
||||
|
|
Loading…
Reference in New Issue