|
|
|
@ -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() {
|
|
|
|
|
<Form.Item
|
|
|
|
|
label='WhatsApp'
|
|
|
|
|
name='whatsAppNo'>
|
|
|
|
|
<Input />
|
|
|
|
|
<Input placeholder='e.g. 8618212345678' />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item>
|
|
|
|
|
<Button type='primary' onClick={handelUpdateWABA}>
|
|
|
|
@ -155,7 +157,7 @@ function Profile() {
|
|
|
|
|
</Typography.Paragraph>
|
|
|
|
|
|
|
|
|
|
<Typography.Paragraph>
|
|
|
|
|
WhatsApp 服务:{waiServer}
|
|
|
|
|
WhatsApp 服务:{isEmpty(waiServer) ? '请联系你的主管申请开通' : waiServer}
|
|
|
|
|
</Typography.Paragraph>
|
|
|
|
|
</Typography>
|
|
|
|
|
</Col>
|
|
|
|
@ -164,6 +166,11 @@ function Profile() {
|
|
|
|
|
<Conditional
|
|
|
|
|
condition={isPermitted(PERM_USE_WHATSAPP)}
|
|
|
|
|
whenTrue={<WAIQRCode />}
|
|
|
|
|
whenFalse={
|
|
|
|
|
<Result
|
|
|
|
|
status='403'
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</Flex>
|
|
|
|
|
</Col>
|
|
|
|
|