mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 桌面端自动下载更新安装包 https://github.com/siyuan-note/siyuan/issues/5837
This commit is contained in:
parent
8f6ffd4dcd
commit
313143304b
7 changed files with 83 additions and 20 deletions
|
|
@ -348,11 +348,21 @@ func exit(c *gin.Context) {
|
|||
force = forceArg.(bool)
|
||||
}
|
||||
|
||||
err := model.Close(force)
|
||||
if nil != err {
|
||||
ret.Code = 1
|
||||
ret.Msg = err.Error() + "<div class=\"fn__space\"></div><button class=\"b3-button b3-button--white\">" + model.Conf.Language(97) + "</button>"
|
||||
execInstallPkgArg := arg["execInstallPkgArg"] // 0:默认检查新版本,1:不执行新版本安装,2:执行新版本安装
|
||||
execInstallPkg := 0
|
||||
if nil != execInstallPkgArg {
|
||||
execInstallPkg = int(execInstallPkgArg.(float64))
|
||||
}
|
||||
|
||||
exitCode := model.Close(force, execInstallPkg)
|
||||
ret.Code = exitCode
|
||||
switch exitCode {
|
||||
case 0:
|
||||
case 1: // 同步执行失败
|
||||
ret.Msg = model.Conf.Language(96) + "<div class=\"fn__space\"></div><button class=\"b3-button b3-button--white\">" + model.Conf.Language(97) + "</button>"
|
||||
ret.Data = map[string]interface{}{"closeTimeout": 0}
|
||||
case 2: // 提示新安装包
|
||||
ret.Msg = model.Conf.Language(61)
|
||||
ret.Data = map[string]interface{}{"closeTimeout": 0}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue