|
@@ -8,7 +8,7 @@ import styles from './Index.less';
|
|
|
const { Header, Content, Footer } = Layout;
|
|
|
const { SubMenu } = Menu;
|
|
|
let timer;
|
|
|
-
|
|
|
+const isMobile = isMobileDevice();
|
|
|
// 布局
|
|
|
function LayoutDetail(props) {
|
|
|
const { currentUser, permission, dispatch, authList } = props;
|
|
@@ -21,15 +21,22 @@ function LayoutDetail(props) {
|
|
|
marginRight: 60,
|
|
|
width: 120,
|
|
|
};
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
+ if (isMobile) return;
|
|
|
// 查询用户信息
|
|
|
- props.dispatch({
|
|
|
+ dispatch({
|
|
|
type: 'user/fetchCurrent',
|
|
|
});
|
|
|
}, []);
|
|
|
|
|
|
useEffect(() => {
|
|
|
+ if (isMobile) return;
|
|
|
if (!currentUser.ID) return;
|
|
|
+ dispatch({
|
|
|
+ type: 'authList/queryAuthList',
|
|
|
+ payload: { user_id: currentUser.ID },
|
|
|
+ });
|
|
|
clearInterval(timer);
|
|
|
timer = setInterval(() => {
|
|
|
dispatch({
|
|
@@ -41,6 +48,30 @@ function LayoutDetail(props) {
|
|
|
return () => clearInterval(timer);
|
|
|
}, [currentUser.ID]);
|
|
|
|
|
|
+ // 不支持移动端使用,做判断
|
|
|
+ if (isMobile) {
|
|
|
+ return (
|
|
|
+ <Layout>
|
|
|
+ <Header>
|
|
|
+ <div style={{ display: 'flex', height: '100%', justifyContent: 'space-between' }}>
|
|
|
+ <div style={{ display: 'flex', width: '70%' }}>
|
|
|
+ <div style={logoStyle}>金科环境</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Header>
|
|
|
+ <Content
|
|
|
+ style={{
|
|
|
+ padding: '50px 0',
|
|
|
+ minHeight: 'calc(100vh - 64px)',
|
|
|
+ textAlign: 'center',
|
|
|
+ fontSize: 24,
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 请使用PC端进行审批
|
|
|
+ </Content>
|
|
|
+ </Layout>
|
|
|
+ );
|
|
|
+ }
|
|
|
return (
|
|
|
<Layout>
|
|
|
<Header>
|
|
@@ -78,6 +109,10 @@ function LayoutDetail(props) {
|
|
|
</Layout>
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+function isMobileDevice() {
|
|
|
+ return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
|
+}
|
|
|
export default connect(({ user, authList }) => ({
|
|
|
currentUser: user.currentUser,
|
|
|
permission: user.currentUser.Permission,
|