mirror of https://github.com/openspug/spug
improve update
parent
75ec899d60
commit
8c297dd205
|
@ -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, notification } from "antd";
|
import { Descriptions, Spin, Button, notification } from 'antd';
|
||||||
import { observer } from 'mobx-react'
|
import { observer } from 'mobx-react'
|
||||||
import { http, VERSION } from 'libs';
|
import { http, VERSION } from 'libs';
|
||||||
|
|
||||||
|
@ -35,7 +35,17 @@ class About extends React.Component {
|
||||||
message: `发现新版本 ${res.version}`,
|
message: `发现新版本 ${res.version}`,
|
||||||
icon: <SmileTwoTone />,
|
icon: <SmileTwoTone />,
|
||||||
btn: <a target="_blank" rel="noopener noreferrer" href="https://spug.dev/docs/update-version/">如何升级?</a>,
|
btn: <a target="_blank" rel="noopener noreferrer" href="https://spug.dev/docs/update-version/">如何升级?</a>,
|
||||||
description: <pre style={{lineHeight: '30px'}}>{res.content}</pre>
|
description: <pre style={{lineHeight: '30px'}}>{res.content}<br/>{res.extra}</pre>
|
||||||
|
})
|
||||||
|
} else if (res.extra) {
|
||||||
|
notification.open({
|
||||||
|
key: 'new_version',
|
||||||
|
duration: 0,
|
||||||
|
top: 88,
|
||||||
|
message: `已是最新版本`,
|
||||||
|
icon: <SmileTwoTone />,
|
||||||
|
btn: <Button type="link" onClick={() => notification.close('new_version')}>知道了</Button>,
|
||||||
|
description: <pre style={{lineHeight: '30px'}}>{res.extra}</pre>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue