diff --git a/src/stores/AuthStore.js b/src/stores/AuthStore.js index 1c856db..06650d6 100644 --- a/src/stores/AuthStore.js +++ b/src/stores/AuthStore.js @@ -11,6 +11,8 @@ export const PERM_USE_EMAL = 'use-email' export const PERM_USE_WHATSAPP = 'use-whatsapp' export const PERM_IMPORT_EMAIL = 'import-email' +const WAI_SERVER_KEY = 'G-STR:WAI_SERVER' + const useAuthStore = create(devtools((set, get) => ({ loginUser: { userId: -1, @@ -29,10 +31,11 @@ const useAuthStore = create(devtools((set, get) => ({ loginStatus: 0, isPermitted: (perm) => { + const { waiServer } = usingStorage(WAI_SERVER_KEY) const { loginUser } = get() if (perm === PERM_USE_WHATSAPP) { - return ['370', '143', '495', '404', '383', '227'].includes(loginUser.userId) + return isNotEmpty(waiServer) // ['370', '143', '495', '404', '383', '227'].includes(loginUser.userId) } if (perm === PERM_USE_EMAL) { diff --git a/src/views/AuthApp.jsx b/src/views/AuthApp.jsx index 666892c..997efc3 100644 --- a/src/views/AuthApp.jsx +++ b/src/views/AuthApp.jsx @@ -11,7 +11,7 @@ import { FloatButton, theme, } from 'antd' -import { BugOutlined } from '@ant-design/icons' +import { BugOutlined, CustomerServiceOutlined } from '@ant-design/icons' import zhLocale from 'antd/locale/zh_CN' import 'dayjs/locale/zh-cn' import { useEffect } from 'react' @@ -111,6 +111,13 @@ function AuthApp() { // 除了路由 /p...以外都需要登陆系统 const needToLogin = loginUser.userId === -1 && href.indexOf('/p/') === -1 + const isMobileApp = + navigator.userAgent.match( + /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i, + ) !== null + + const floatButtonLineEnd = isMobileApp ? 0 : 24 + useEffect(() => { if (needToLogin) { navigate('/p/dingding/login?origin_url=' + href) @@ -136,10 +143,12 @@ function AuthApp() { } > } tooltip={
上传日志给研发部
} onClick={() => uploadLog()} /> diff --git a/src/views/accounts/Profile.jsx b/src/views/accounts/Profile.jsx index 1e67b95..6e5d677 100644 --- a/src/views/accounts/Profile.jsx +++ b/src/views/accounts/Profile.jsx @@ -1,10 +1,12 @@ import { useEffect, useCallback } from 'react' -import { Row, Col, Space, Input, Descriptions, Avatar, Tag, Divider, List, App, Button, Flex, Select, Form, Typography, Tooltip } from 'antd' +import { Row, Col, Space, Input, Descriptions, Avatar, Tag, Divider, List, App, Button, Flex, Select, Form, Typography, Tooltip, Result } from 'antd' import { UserOutlined, InfoCircleOutlined } from '@ant-design/icons' import useAuthStore from '@/stores/AuthStore' import { Conditional } from '@/components/Conditional' import { PERM_USE_WHATSAPP } from '@/stores/AuthStore' import { usingStorage } from '@/utils/usingStorage'; + +import { isEmpty } from '@/utils/commons' import { WAI_SERVER_KEY } from '@/config'; import WAIQRCode from './WAIQRCode'; @@ -112,7 +114,7 @@ function Profile() { - +