refactor:优化结构

This commit is contained in:
Mmx
2021-05-03 14:09:22 +08:00
parent 487c22846a
commit fb562f92c9
4 changed files with 62 additions and 73 deletions

View File

@@ -10,3 +10,17 @@ type Config struct {
Meta LoginMeta `json:"meta"`
Settings Settings `json:"settings"`
}
func (a *Config) Generate() *LoginInfo {
return &LoginInfo{
UrlLoginPage: "http://" + a.From.Domain + "/srun_portal_success",
UrlGetChallengeApi: "http://" + a.From.Domain + "/cgi-bin/get_challenge",
UrlLoginApi: "http://" + a.From.Domain + "/cgi-bin/srun_portal",
UrlCheckApi: "http://" + a.From.Domain + "/cgi-bin/rad_user_info",
Meta: &a.Meta,
Form: &LoginForm{
UserName: a.From.UserName + "@cmcc",
PassWord: a.From.PassWord,
},
}
}