优化代码

pull/43/head
smallbun 2023-09-08 12:41:39 +08:00
parent 207d0ff7f7
commit 4f52d44966
4 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Avatar, Image } from 'antd'; import { Avatar, Image } from 'antd';
import { AvatarSize } from 'antd/es/avatar/SizeContext'; import { AvatarSize } from 'antd/es/avatar/AvatarContext';
export default (props: { export default (props: {
avatar: string; avatar: string;

View File

@ -46,7 +46,7 @@ export default () => {
history.push(`/account/user`); history.push(`/account/user`);
return; return;
} }
if (!type) { if (!type || !UserDetailTabs[type]) {
setTabActiveKey(UserDetailTabs.user_info); setTabActiveKey(UserDetailTabs.user_info);
history.replace({ history.replace({
pathname: location.pathname, pathname: location.pathname,

View File

@ -55,7 +55,7 @@ export default () => {
history.push(`/account/user-group`); history.push(`/account/user-group`);
return; return;
} }
if (!type) { if (!type || !UserGroupDetailTabs[type]) {
setTabActiveKey(UserGroupDetailTabs.member); setTabActiveKey(UserGroupDetailTabs.member);
history.push({ history.push({
pathname: location.pathname, pathname: location.pathname,

View File

@ -99,7 +99,7 @@ const UpdateUser = (props: UpdateFormProps) => {
*/ */
const cancel = async () => { const cancel = async () => {
if (onCancel) { if (onCancel) {
await onCancel(); onCancel();
} }
setSubmitLoading(false); setSubmitLoading(false);
form.resetFields(); form.resetFields();