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 { func getConfig() model.Config {
var config model.Config var config model.Config
config.RefreshDoor = viper.GetBool("server.refresh_door")
config.Quality = viper.GetString("images.quality") config.Quality = viper.GetString("images.quality")
config.UserName = viper.GetString("user.username") config.UserName = viper.GetString("user.username")
config.PassWord = viper.GetString("user.password") config.PassWord = viper.GetString("user.password")

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

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

Loading…
Cancel
Save