fix issues

pull/410/head
vapao 2021-09-28 14:04:31 +08:00
parent 804107196a
commit f26635e9ad
1 changed files with 6 additions and 3 deletions

View File

@ -6,7 +6,7 @@
import React from 'react'; import React from 'react';
import styles from './index.module.css'; import styles from './index.module.css';
import { SmileTwoTone } from '@ant-design/icons'; import { SmileTwoTone } from '@ant-design/icons';
import { Descriptions, Spin, Button, notification } from 'antd'; import { Descriptions, Spin, Button, Alert, notification } from 'antd';
import { observer } from 'mobx-react' import { observer } from 'mobx-react'
import { http, VERSION } from 'libs'; import { http, VERSION } from 'libs';
@ -33,7 +33,7 @@ class About extends React.Component {
duration: 0, duration: 0,
top: 88, top: 88,
message: `发现新版本 ${res.version}`, message: `发现新版本 ${res.version}`,
icon: <SmileTwoTone />, icon: <SmileTwoTone/>,
btn: <a target="_blank" rel="noopener noreferrer" href="https://spug.cc/docs/update-version/">如何升级</a>, btn: <a target="_blank" rel="noopener noreferrer" href="https://spug.cc/docs/update-version/">如何升级</a>,
description: <pre style={{lineHeight: '30px'}}>{res.content}<br/>{res.extra}</pre> description: <pre style={{lineHeight: '30px'}}>{res.content}<br/>{res.extra}</pre>
}) })
@ -43,7 +43,7 @@ class About extends React.Component {
duration: 0, duration: 0,
top: 88, top: 88,
message: `已是最新版本`, message: `已是最新版本`,
icon: <SmileTwoTone />, icon: <SmileTwoTone/>,
btn: <Button type="link" onClick={() => notification.close('new_version')}>知道了</Button>, btn: <Button type="link" onClick={() => notification.close('new_version')}>知道了</Button>,
description: <pre style={{lineHeight: '30px'}}>{res.extra}</pre> description: <pre style={{lineHeight: '30px'}}>{res.extra}</pre>
}) })
@ -71,6 +71,9 @@ class About extends React.Component {
rel="noopener noreferrer">https://spug.cc/docs/change-log/</a> rel="noopener noreferrer">https://spug.cc/docs/change-log/</a>
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
{info['spug_version'] !== VERSION && (
<Alert showIcon style={{width: 500}} type="warning" message="Spug API版本与Web版本不匹配请尝试刷新浏览器后再次查看。"/>
)}
</Spin> </Spin>
) )
} }