feat: Separate declaration and refresh access control

main
zggsong 2 years ago
parent 41588cb2c5
commit 7eda5dc7e6

@ -41,6 +41,7 @@ func InitialConfig() model.Config {
func getConfig() model.Config {
var config model.Config
config.RefreshDoor = viper.GetBool("server.refresh_door")
config.Quality = viper.GetString("images.quality")
config.UserName = viper.GetString("user.username")
config.PassWord = viper.GetString("user.password")

@ -75,6 +75,7 @@ type BarkResp struct {
// @Description: config model
//
type Config struct {
RefreshDoor bool
Quality string
UserName string
PassWord string

@ -141,7 +141,11 @@ func DeclarationService(files map[string]string) {
}
log.Infof("每日申报成功")
util.SendSuccess("【成功】每日申报")
if !global.GLO_CONFIG.RefreshDoor {
return
}
//刷新门禁
for i := 0; i < 3; i++ {
err = core.RefreshDoor(auth, __user__)
@ -154,8 +158,7 @@ func DeclarationService(files map[string]string) {
}
}
log.Infof("刷新门禁成功")
util.SendSuccess("【成功】每日申报、刷新门禁")
util.SendSuccess("【成功】刷新门禁")
}
//

Loading…
Cancel
Save