|
@@ -2,10 +2,11 @@ import React from 'react';
|
2
|
2
|
import { View } from '@tarojs/components';
|
3
|
3
|
import { useModel } from '@/store';
|
4
|
4
|
import { Loading } from '@antmjs/vantui';
|
|
5
|
+import Auth from '@/components/Auth';
|
5
|
6
|
import laySty from './layout.module.less';
|
6
|
7
|
|
7
|
8
|
export default (props) => {
|
8
|
|
- const { className, style } = props;
|
|
9
|
+ const { className, style, roles } = props;
|
9
|
10
|
|
10
|
11
|
const { person } = useModel('user');
|
11
|
12
|
|
|
@@ -16,13 +17,15 @@ export default (props) => {
|
16
|
17
|
{
|
17
|
18
|
!person && (
|
18
|
19
|
<View className={laySty.loading}>
|
19
|
|
- <Loading size="32px" vertical>
|
|
20
|
+ <Loading size="32px" vertical>
|
20
|
21
|
加载中...
|
21
|
22
|
</Loading>
|
22
|
23
|
</View>
|
23
|
24
|
)
|
24
|
25
|
}
|
|
26
|
+ <Auth roles={roles}>
|
25
|
27
|
{props.children}
|
|
28
|
+ </Auth>
|
26
|
29
|
</View>
|
27
|
30
|
)
|
28
|
31
|
}
|