improve: 优化 DDNS 配置读取形式
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/Mmx233/BitSrunLoginGo/dns"
|
||||
"github.com/Mmx233/BitSrunLoginGo/global"
|
||||
"github.com/Mmx233/BitSrunLoginGo/util"
|
||||
BitSrun "github.com/Mmx233/BitSrunLoginGo/v1"
|
||||
@@ -59,29 +58,23 @@ func Login(localAddr net.Addr, debugOutput bool) error {
|
||||
}
|
||||
|
||||
log.Infoln("登录成功~")
|
||||
}
|
||||
|
||||
// DDNS
|
||||
// DDNS
|
||||
if global.Config.Settings.DDNS.Enable {
|
||||
log.Debugln("开始 DDNS 设置流程")
|
||||
|
||||
enable, _ := global.Config.Settings.DDNS["enable"]
|
||||
if open, _ := enable.(bool); open {
|
||||
log.Debugln("开始 DDNS 设置流程")
|
||||
if global.Config.Settings.DDNS.Provider == "" {
|
||||
log.Warnln("DDNS 模块 dns 运营商不能为空")
|
||||
return nil
|
||||
}
|
||||
|
||||
provider, _ := global.Config.Settings.DDNS["provider"]
|
||||
providerStr, _ := provider.(string)
|
||||
if providerStr == "" {
|
||||
log.Warnln("DDNS 模块 dns 运营商不能为空")
|
||||
return nil
|
||||
/*_ = dns.Run(&dns.Config{
|
||||
Provider: providerStr,
|
||||
IP: ip,
|
||||
Conf: global.Config.Settings.DDNS,
|
||||
Http: httpClient,
|
||||
})*/
|
||||
}
|
||||
|
||||
delete(global.Config.Settings.DDNS, "provider")
|
||||
|
||||
_ = dns.Run(&dns.Config{
|
||||
Provider: providerStr,
|
||||
IP: ip,
|
||||
Conf: global.Config.Settings.DDNS,
|
||||
Http: httpClient,
|
||||
})
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user