张涛 1 rok temu
rodzic
commit
02961d6817

+ 1
- 5
src/layouts/AuthLayout/components/Header/User.jsx Wyświetl plik

@@ -29,16 +29,13 @@ const DefaultAvatar = ({ color = "#1296db" }) => (
29 29
 );
30 30
 
31 31
 const ChangePassword = forwardRef((props, ref) => {
32
-  const { user } = props;
33 32
 
34 33
   const [visible, setVisible] = useState(false);
35 34
 
36 35
   const onFinish = async (values) => {
37
-    // console.log('---values---->', values)
38 36
     const data = {
39 37
       password: values.newPassword,
40 38
     };
41
-    // console.log('---ff---->', data)
42 39
     await changePassword(data);
43 40
 
44 41
     return true;
@@ -109,11 +106,10 @@ export default (props) => {
109 106
       passRef.current.show();
110 107
     }
111 108
   };
112
-console.log(user)
113 109
   return (
114 110
     <Dropdown menu={{ items, onClick }}>
115 111
       <div className="user-info">
116
-        <Avatar size={24} src={user?.account || <DefaultAvatar />} />
112
+        <Avatar size={24} src={<DefaultAvatar />} />
117 113
         <span className="font">{user?.userName}</span>
118 114
         <ChangePassword user={user} ref={passRef} />
119 115
       </div>

+ 6
- 6
src/routes/routes.jsx Wyświetl plik

@@ -27,10 +27,10 @@ import UserEdit from "@/pages/user/Edit";
27 27
  */
28 28
 
29 29
 export const authRoutes = [
30
-  // {
31
-  //   index: true,
32
-  //   element: <Navigate to="/login" replace={true} />,
33
-  // },
30
+  {
31
+    index: true,
32
+    element: <Navigate to="/custom" replace={true} />,
33
+  },
34 34
   {
35 35
     path: "custom",
36 36
     element: <Custom />,
@@ -102,7 +102,7 @@ export const defaultRoutes = [
102 102
   },
103 103
 ];
104 104
 
105
-export function mergeAuthRoutes(r1, r2) {
105
+export function mergeAuthRoutes (r1, r2) {
106 106
   const r = r1.slice();
107 107
   const children = r1[0].children.slice();
108 108
   r[0].children = children.concat(r2);
@@ -112,7 +112,7 @@ export function mergeAuthRoutes(r1, r2) {
112 112
 
113 113
 // 全部路由
114 114
 export const routes = mergeAuthRoutes(defaultRoutes, authRoutes);
115
-function getPath(parent = "/", current = "") {
115
+function getPath (parent = "/", current = "") {
116 116
   if (current.indexOf("/") === 0 || current.indexOf("http") === 0)
117 117
     return current;
118 118
   return `${parent}/${current}`.replace(/\/\//g, "/");