张涛 1 rok temu
rodzic
commit
94449a06e8
2 zmienionych plików z 2 dodań i 7 usunięć
  1. 1
    1
      src/app.js
  2. 1
    6
      src/components/Auth.jsx

+ 1
- 1
src/app.js Wyświetl plik

@@ -7,7 +7,7 @@ import "@antmjs/vantui/lib/index.less";
7 7
 const App = (props) => {
8 8
   useEffect(() => {
9 9
     const userState = store.getState("user");
10
-    // userState.current();
10
+    userState.current();
11 11
   }, []);
12 12
 
13 13
   return <Provider>{props.children}</Provider>;

+ 1
- 6
src/components/Auth.jsx Wyświetl plik

@@ -16,13 +16,8 @@ export default (props) => {
16 16
   console.log("roles", roles);
17 17
   console.log("!roles.length || hasRights", !roles.length || hasRights);
18 18
 
19
-
20
-  const filteredChildren = React.Children.toArray(props.children).filter(
21
-    child => React.isValidElement(child)
22
-  );
23
-
24 19
   return !roles.length || hasRights ? (
25
-   <div>{filteredChildren}</div>
20
+   <div>{props.children}</div>
26 21
   ) : (
27 22
     <View
28 23
       style={{