style: 移动登录信息结构体位置
This commit is contained in:
@@ -3,6 +3,7 @@ package global
|
||||
import (
|
||||
"github.com/Mmx233/BitSrunLoginGo/models"
|
||||
"github.com/Mmx233/BitSrunLoginGo/util"
|
||||
"github.com/Mmx233/BitSrunLoginGo/v1/transfer"
|
||||
"github.com/Mmx233/config"
|
||||
"log"
|
||||
"os"
|
||||
@@ -17,11 +18,11 @@ func init() {
|
||||
if e := config.Load(config.Options{
|
||||
Config: &Config,
|
||||
Default: &srunModels.Config{
|
||||
Form: srunModels.LoginForm{
|
||||
Form: srunTransfer.LoginForm{
|
||||
Domain: "www.msftconnecttest.com",
|
||||
UserType: "cmcc",
|
||||
},
|
||||
Meta: srunModels.LoginMeta{
|
||||
Meta: srunTransfer.LoginMeta{
|
||||
N: "200",
|
||||
Type: "1",
|
||||
Acid: "5",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package srunModels
|
||||
|
||||
import "github.com/Mmx233/BitSrunLoginGo/v1/transfer"
|
||||
|
||||
type Daemon struct {
|
||||
Enable bool `json:"enable"`
|
||||
Path string `json:"path"`
|
||||
@@ -18,7 +20,7 @@ type Settings struct {
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Form LoginForm `json:"form"`
|
||||
Meta LoginMeta `json:"meta"`
|
||||
Settings Settings `json:"settings"`
|
||||
Form srunTransfer.LoginForm `json:"form"`
|
||||
Meta srunTransfer.LoginMeta `json:"meta"`
|
||||
Settings Settings `json:"settings"`
|
||||
}
|
||||
|
||||
@@ -1,18 +1,6 @@
|
||||
package srunModels
|
||||
|
||||
type LoginForm struct {
|
||||
Domain string `json:"domain"`
|
||||
UserName string `json:"username"`
|
||||
UserType string `json:"user_type"`
|
||||
PassWord string `json:"password"`
|
||||
}
|
||||
|
||||
type LoginMeta struct {
|
||||
N string `json:"n"`
|
||||
Type string `json:"type"`
|
||||
Acid string `json:"acid"`
|
||||
Enc string `json:"enc"`
|
||||
}
|
||||
import "github.com/Mmx233/BitSrunLoginGo/v1/transfer"
|
||||
|
||||
type LoginInfo struct {
|
||||
UrlLoginPage string
|
||||
@@ -28,6 +16,6 @@ type LoginInfo struct {
|
||||
EncryptedChkstr string
|
||||
LoginResult string
|
||||
|
||||
Form *LoginForm
|
||||
Meta *LoginMeta
|
||||
Form *srunTransfer.LoginForm
|
||||
Meta *srunTransfer.LoginMeta
|
||||
}
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package util
|
||||
|
||||
import "github.com/Mmx233/BitSrunLoginGo/models"
|
||||
import (
|
||||
"github.com/Mmx233/BitSrunLoginGo/models"
|
||||
"github.com/Mmx233/BitSrunLoginGo/v1/transfer"
|
||||
)
|
||||
|
||||
func GenerateLoginInfo(Form *srunModels.LoginForm, Meta *srunModels.LoginMeta) *srunModels.LoginInfo {
|
||||
func GenerateLoginInfo(Form *srunTransfer.LoginForm, Meta *srunTransfer.LoginMeta) *srunModels.LoginInfo {
|
||||
return &srunModels.LoginInfo{
|
||||
UrlLoginPage: "http://" + Form.Domain + "/srun_portal_success",
|
||||
UrlGetChallengeApi: "http://" + Form.Domain + "/cgi-bin/get_challenge",
|
||||
UrlLoginApi: "http://" + Form.Domain + "/cgi-bin/srun_portal",
|
||||
UrlCheckApi: "http://" + Form.Domain + "/cgi-bin/rad_user_info",
|
||||
Meta: Meta,
|
||||
Form: &srunModels.LoginForm{
|
||||
Form: &srunTransfer.LoginForm{
|
||||
UserName: Form.UserName + "@" + Form.UserType,
|
||||
PassWord: Form.PassWord,
|
||||
},
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
package srunTransfer
|
||||
|
||||
import "github.com/Mmx233/BitSrunLoginGo/models"
|
||||
type LoginForm struct {
|
||||
Domain string `json:"domain"`
|
||||
UserName string `json:"username"`
|
||||
UserType string `json:"user_type"`
|
||||
PassWord string `json:"password"`
|
||||
}
|
||||
|
||||
type LoginMeta struct {
|
||||
N string `json:"n"`
|
||||
Type string `json:"type"`
|
||||
Acid string `json:"acid"`
|
||||
Enc string `json:"enc"`
|
||||
}
|
||||
|
||||
type LoginInfo struct {
|
||||
Form *srunModels.LoginForm
|
||||
Meta *srunModels.LoginMeta
|
||||
Form *LoginForm
|
||||
Meta *LoginMeta
|
||||
}
|
||||
|
||||
type Login struct {
|
||||
|
||||
Reference in New Issue
Block a user