修复版本号匹配

This commit is contained in:
hanhh 2021-10-13 22:45:24 +08:00
parent 56e43f1808
commit df8a3d2692
2 changed files with 5 additions and 6 deletions

View File

@ -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];

View File

@ -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: '更新',