mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修复版本号匹配
This commit is contained in:
parent
56e43f1808
commit
df8a3d2692
|
@ -380,9 +380,8 @@ export default class UserService {
|
|||
|
||||
public async checkUpdate() {
|
||||
try {
|
||||
const versionRegx = /.*export const version = (.*)\n/;
|
||||
const logRegx = /.*export const changeLog = (.*)\n/;
|
||||
const linkRegx = /.*export const changeLogLink = (.*)\n/;
|
||||
const versionRegx = /.*export const version = \'(.*)\'\n/;
|
||||
const logRegx = /.*export const changeLog = \`(.*)\`/;
|
||||
|
||||
const currentVersionFile = fs.readFileSync(config.versionFile, 'utf8');
|
||||
const currentVersion = currentVersionFile.match(versionRegx)![1];
|
||||
|
|
|
@ -40,14 +40,14 @@ const CheckUpdate = ({ ws }: any) => {
|
|||
};
|
||||
|
||||
const showConfirmUpdateModal = (data: any) => {
|
||||
const { version: newVersion, changeLog } = data;
|
||||
const { lastVersion, lastLog } = data;
|
||||
Modal.confirm({
|
||||
width: 500,
|
||||
title: (
|
||||
<>
|
||||
<div>更新可用</div>
|
||||
<div style={{ fontSize: 12, fontWeight: 400, marginTop: 5 }}>
|
||||
新版本{newVersion}可用。你使用的版本为{version}。
|
||||
新版本{lastVersion}可用。你使用的版本为{version}。
|
||||
</div>
|
||||
</>
|
||||
),
|
||||
|
@ -61,7 +61,7 @@ const CheckUpdate = ({ ws }: any) => {
|
|||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
{changeLog}
|
||||
{lastLog}
|
||||
</pre>
|
||||
),
|
||||
okText: '更新',
|
||||
|
|
Loading…
Reference in New Issue
Block a user