diff --git a/src/stores/AuthStore.js b/src/stores/AuthStore.js index fe6802d..9b842cf 100644 --- a/src/stores/AuthStore.js +++ b/src/stores/AuthStore.js @@ -7,6 +7,7 @@ import { API_HOST, BUILD_VERSION } from '@/config' export const PERM_MERGE_CONVERSATION = 'merge-conversation' export const PERM_ASSIGN_NEW_CONVERSATION = 'assign-new-conversation' export const PERM_USE_EMAL = 'use-email' +export const PERM_USE_WHATSAPP = 'use-whatsapp' export const PERM_IMPORT_EMAIL = 'import-email' const useAuthStore = create(devtools((set, get) => ({ @@ -30,7 +31,7 @@ const useAuthStore = create(devtools((set, get) => ({ const { loginUser } = get() if (perm === PERM_USE_EMAL) { - return ['501', '466', '599', '495', '143', '370', '639', '513', '654', '404', '383', '227'].includes(loginUser.userId) + return true//['501', '466', '599', '495', '143', '370', '639', '513', '654', '404', '383', '227'].includes(loginUser.userId) } // 导入邮件消息,需要配置才能使用 diff --git a/src/views/AuthApp.jsx b/src/views/AuthApp.jsx index 661e1a3..ea8e0ff 100644 --- a/src/views/AuthApp.jsx +++ b/src/views/AuthApp.jsx @@ -1,9 +1,7 @@ import ErrorBoundary from '@/components/ErrorBoundary' import useAuthStore from '@/stores/AuthStore' import { useThemeContext } from '@/stores/ThemeContext' -import { Conditional } from '@/components/Conditional' import useConversationStore from '@/stores/ConversationStore' -import { PERM_USE_EMAL } from '@/stores/AuthStore' import { App as AntApp, ConfigProvider, @@ -13,7 +11,7 @@ import { FloatButton, theme, } from 'antd' -import { BugOutlined, MailOutlined } from '@ant-design/icons' +import { BugOutlined } from '@ant-design/icons' import zhLocale from 'antd/locale/zh_CN' import 'dayjs/locale/zh-cn' import { useEffect } from 'react' @@ -38,8 +36,8 @@ function AuthApp() { const [messageApi, contextHolder] = message.useMessage() const { colorPrimary, borderRadius } = useThemeContext() - const [loginUser, sendNotify, isPermitted] = useAuthStore((state) => [ - state.loginUser, state.sendNotify, state.isPermitted + const [loginUser, sendNotify] = useAuthStore((state) => [ + state.loginUser, state.sendNotify ]) const href = useHref() @@ -64,10 +62,7 @@ function AuthApp() { connectWebsocket(loginUser.userId) fetchInitialData(loginUser) - let _fetchEmailWorker; - if (isPermitted(PERM_USE_EMAL)) { - _fetchEmailWorker = startEmailInterval(loginUser.userId) - } + _fetchEmailWorker = startEmailInterval(loginUser.userId) } return () => { disconnectWebsocket() @@ -136,10 +131,7 @@ function AuthApp() { insetInlineEnd: 94, }} > - } - /> + } tooltip={
上传日志给研发部
} onClick={() => uploadLog()} /> diff --git a/src/views/Conversations/Online/ReplyWrapper.jsx b/src/views/Conversations/Online/ReplyWrapper.jsx index ef19807..19f059d 100644 --- a/src/views/Conversations/Online/ReplyWrapper.jsx +++ b/src/views/Conversations/Online/ReplyWrapper.jsx @@ -10,7 +10,7 @@ import useStyleStore from '@/stores/StyleStore'; import { isEmpty } from '@/utils/commons'; import { DEFAULT_CHANNEL } from '@/config'; import { WABAccounts, WABAccountsMapped } from '@/channel/bubbleMsgUtils'; -import useAuthStore, { PERM_USE_EMAL} from '@/stores/AuthStore'; +import useAuthStore from '@/stores/AuthStore'; /** * @ignore @@ -73,7 +73,7 @@ const ReplyWrapper = () => { const replyTypes = [ // { key: 'waba', label: mobile ? '' : (), icon: , children: }, { key: 'waba', label: mobile ? '' : `商业号(${WABAccountsMapped[whatsAppBusiness]?.verifiedName || '-'})`, icon: , children: }, - { key: 'email', label: mobile ? '' : '邮件', icon: , children: isPermitted(PERM_USE_EMAL) ? :
敬请期待
}, + { key: 'email', label: mobile ? '' : '邮件', icon: , children: }, // { key: 'whatsapp', label: mobile ? '' : 'WhatsApp', icon: , children: }, { key: 'wa', label: mobile ? '' : 'WhatsApp', icon: , children:
正在开发……敬请期待
}, // TODO: ⬆️WA未登录,要提示用户到个人页面扫码