master
guofei 2024-06-04 23:47:54 +08:00
parent 24a7eeb5e3
commit d6d86ed657
4 changed files with 14 additions and 3 deletions

View File

@ -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();

View File

@ -48,6 +48,12 @@ const Page = () => {
align: 'center',
hideInSearch: true,
},
{
title: '修改时间',
dataIndex: 'updateTime',
align: 'center',
hideInSearch: true,
},
{
title: '最后登录时间',
dataIndex: 'lastLoginTime',

View File

@ -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}`);
};

View File

@ -3,7 +3,7 @@ declare namespace SuperAdmin {
id: string;
userName: string;
email?: string;
password: string;
password?: string;
phone?: string;
picture?: string;
isFirstLogin: boolean;