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