refactor: response
This commit is contained in:
parent
fcd5afbe13
commit
5b36a0e24d
|
|
@ -137,16 +137,15 @@ func (u *User) PkgCheck() *response.Response {
|
|||
Button(New(u.params).LackButton()...)
|
||||
}
|
||||
|
||||
// 先判断是否强制更新
|
||||
// 先判断是否强制更新:expireCheck 已设置强制更新文案且不可关闭,直接返回
|
||||
if resp = u.expireCheck(userPkg, u.params.Int(config.ServiceForceUpdateDay)); resp != nil {
|
||||
resp.Closable(false).Title(u.params.Str(config.ServiceForceUpdateNotice))
|
||||
return resp
|
||||
}
|
||||
|
||||
// 判断是否提示更新
|
||||
// 判断是否提示更新:覆盖为更新提示文案,且允许关闭
|
||||
if resp = u.expireCheck(userPkg, u.params.Int(config.ServiceUpdateBeforeDay)); resp != nil {
|
||||
msg := fmt.Sprintf(u.params.Str(config.ServiceUpdateNotice), time.Unix(userPkg.Pkg.ExpireTime, 0).Format("2006-01-02"))
|
||||
resp.Closable(true).Title(msg)
|
||||
resp.Closable(true).Message(msg)
|
||||
return resp
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue