mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
增加新版本检测
This commit is contained in:
parent
686baa56f4
commit
632514d36e
|
@ -13,9 +13,9 @@ import config from '@/utils/config';
|
||||||
import { request } from '@/utils/http';
|
import { request } from '@/utils/http';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
import vhCheck from 'vh-check';
|
import vhCheck from 'vh-check';
|
||||||
import { version, changeLog } from '../version';
|
import { version, changeLogLink, changeLog } from '../version';
|
||||||
import { useCtx, useTheme } from '@/utils/hooks';
|
import { useCtx, useTheme } from '@/utils/hooks';
|
||||||
import { message, Badge, Typography } from 'antd';
|
import { message, Badge, Modal } from 'antd';
|
||||||
|
|
||||||
export default function (props: any) {
|
export default function (props: any) {
|
||||||
const ctx = useCtx();
|
const ctx = useCtx();
|
||||||
|
@ -88,6 +88,38 @@ export default function (props: any) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const showNewVersionModal = () => {
|
||||||
|
Modal.confirm({
|
||||||
|
width: 500,
|
||||||
|
title: (
|
||||||
|
<>
|
||||||
|
<div>更新可用</div>
|
||||||
|
<div style={{ fontSize: 12, fontWeight: 400, marginTop: 5 }}>
|
||||||
|
新版本5.8.0 (1780)可用。你使用的版本为{version}。
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
content: (
|
||||||
|
<pre
|
||||||
|
style={{
|
||||||
|
wordBreak: 'break-all',
|
||||||
|
whiteSpace: 'pre-wrap',
|
||||||
|
paddingTop: 15,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: 400,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{changeLog}
|
||||||
|
</pre>
|
||||||
|
),
|
||||||
|
okText: '更新',
|
||||||
|
cancelText: '以后再说',
|
||||||
|
onOk() {
|
||||||
|
console.log('ok');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
vhCheck();
|
vhCheck();
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -144,13 +176,9 @@ export default function (props: any) {
|
||||||
title={
|
title={
|
||||||
<>
|
<>
|
||||||
控制面板
|
控制面板
|
||||||
<span
|
<span onClick={showNewVersionModal}>
|
||||||
onClick={() => {
|
|
||||||
alert('yes');
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Badge
|
<Badge
|
||||||
count={'new'}
|
count={'New'}
|
||||||
size="small"
|
size="small"
|
||||||
offset={[15, 0]}
|
offset={[15, 0]}
|
||||||
style={{
|
style={{
|
||||||
|
@ -160,7 +188,7 @@ export default function (props: any) {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href={changeLog}
|
href={changeLogLink}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
|
@ -176,7 +204,7 @@ export default function (props: any) {
|
||||||
letterSpacing: isQQBrowser ? -2 : 0,
|
letterSpacing: isQQBrowser ? -2 : 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{version}
|
v{version}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|
|
@ -1,2 +1,7 @@
|
||||||
export const version = 'v2.9.7';
|
export const version = '2.9.7';
|
||||||
export const changeLog = 'https://t.me/jiao_long/184';
|
export const changeLogLink = 'https://t.me/jiao_long/184';
|
||||||
|
export const changeLog = `2.9.7版本说明
|
||||||
|
1. 重构初始化流程,可直接在初始化过程中设置账户信息和通知方式
|
||||||
|
2. 增加企业微信机器人推送的python版本,感谢 https://github.com/Sowevo PR
|
||||||
|
3. 修复ql repo可能无法拉取最新代码
|
||||||
|
`;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user