mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
修复版本号匹配正则
This commit is contained in:
parent
7acda0c039
commit
efa1fcfbdf
|
@ -380,8 +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 = \'(.*)\'\;/;
|
||||||
const logRegx = /.*export const changeLog = \`(.*)\`/;
|
const logRegx = /.*export const changeLog = \`(.*)\`\;/;
|
||||||
|
|
||||||
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];
|
||||||
|
@ -390,7 +390,9 @@ export default class UserService {
|
||||||
await got.get(config.lastVersionFile)
|
await got.get(config.lastVersionFile)
|
||||||
).body;
|
).body;
|
||||||
const lastVersion = lastVersionFileContent.match(versionRegx)![1];
|
const lastVersion = lastVersionFileContent.match(versionRegx)![1];
|
||||||
const lastLog = lastVersionFileContent.match(logRegx)![1];
|
const lastLog = lastVersionFileContent.match(logRegx)
|
||||||
|
? lastVersionFileContent.match(logRegx)![1]
|
||||||
|
: '';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
code: 200,
|
code: 200,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user