{serverPath.map((item) => {
const links = item.links.map((link) => {
@@ -54,7 +65,7 @@ const ServerPath = () => {
navigate(`/${item.path}`);
}
}}>
-
{_path}
+
{_path}
);
});
diff --git a/src/pages/org/layouts/index.tsx b/src/pages/org/layouts/index.tsx
index be7811e..a3006cc 100644
--- a/src/pages/org/layouts/index.tsx
+++ b/src/pages/org/layouts/index.tsx
@@ -1,4 +1,4 @@
import { LayoutMain } from '@/modules/layout';
export const Main = () => {
- return
;
+ return
;
};
diff --git a/src/pages/user/edit/Profile.tsx b/src/pages/user/edit/Profile.tsx
index 9aaf1e7..9d31e22 100644
--- a/src/pages/user/edit/Profile.tsx
+++ b/src/pages/user/edit/Profile.tsx
@@ -1,4 +1,4 @@
-import { InputAdornment, TextField, Tooltip } from '@mui/material';
+import { Dialog, DialogContent, DialogTitle, InputAdornment, TextField, Tooltip } from '@mui/material';
import { useForm, Controller } from 'react-hook-form';
import { Button } from '@mui/material';
import { useUserStore } from '../store';
@@ -12,6 +12,56 @@ import { FileUpload } from '../module/FileUpload';
import { useTranslation } from 'react-i18next';
import { Edit } from 'lucide-react';
import { toast } from 'react-toastify';
+import { useAdminStore } from '../admin/store/admin-store';
+export const CheckUserExistModal = () => {
+ const { t } = useTranslation();
+ const userStore = useUserStore(
+ useShallow((state) => {
+ return {
+ showCheckUserExist: state.showCheckUserExist,
+ setShowCheckUserExist: state.setShowCheckUserExist,
+ };
+ }),
+ );
+ const adminStore = useAdminStore(
+ useShallow((state) => {
+ return {
+ checkUserExist: state.checkUserExist,
+ };
+ }),
+ );
+ const onClose = () => {
+ userStore.setShowCheckUserExist(false);
+ };
+ const [username, setUsername] = useState('@');
+
+ const onCheck = async () => {
+ const res = await adminStore.checkUserExist(username);
+ console.log(res);
+ if (res === false) {
+ toast.info('当前用户名可以修改,点击右上角关注公众号联系客服修改。', {
+ autoClose: 20000,
+ });
+ // toast.success(t('Check success'));
+ } else {
+ toast.error('当前用户名已存在,请更换其他用户名。');
+ }
+ };
+ return (
+
+ );
+};
export const Profile = () => {
const { t } = useTranslation();
@@ -32,6 +82,7 @@ export const Profile = () => {
updateData: state.updateData,
setFormData: state.setFormData,
updateSelf: state.updateSelf,
+ setShowCheckUserExist: state.setShowCheckUserExist,
};
}),
);
@@ -104,9 +155,7 @@ export const Profile = () => {
className='w-4 h-4 cursor-pointer text-primary'
onClick={() => {
console.log('onClick edit');
- toast.info('联系客服修改,因为名称和上传文件绑定了。', {
- autoClose: 20000,
- });
+ userStore.setShowCheckUserExist(true);
}}
/>
@@ -153,6 +202,7 @@ export const Profile = () => {