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