@@ -10,10 +10,13 @@ var defaultConfig = ConfFromFile{
|
|||||||
UserType: "cmcc",
|
UserType: "cmcc",
|
||||||
},
|
},
|
||||||
Meta: srun.LoginMeta{
|
Meta: srun.LoginMeta{
|
||||||
N: "200",
|
N: "200",
|
||||||
Type: "1",
|
Type: "1",
|
||||||
Acid: "5",
|
Acid: "5",
|
||||||
Enc: "srun_bx1",
|
Enc: "srun_bx1",
|
||||||
|
OS: "Windows 10",
|
||||||
|
Name: "windows",
|
||||||
|
DoubleStack: false,
|
||||||
},
|
},
|
||||||
Settings: SettingsConf{
|
Settings: SettingsConf{
|
||||||
Basic: BasicConf{
|
Basic: BasicConf{
|
||||||
|
|||||||
@@ -9,10 +9,13 @@ type LoginForm struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type LoginMeta struct {
|
type LoginMeta struct {
|
||||||
N string `json:"n" yaml:"n"`
|
N string `json:"n" yaml:"n"`
|
||||||
Type string `json:"type" yaml:"type"`
|
Type string `json:"type" yaml:"type"`
|
||||||
Acid string `json:"acid" yaml:"acid"`
|
Acid string `json:"acid" yaml:"acid"`
|
||||||
Enc string `json:"enc" yaml:"enc"`
|
Enc string `json:"enc" yaml:"enc"`
|
||||||
|
OS string `json:"os" yaml:"os"`
|
||||||
|
Name string `json:"name" yaml:"name"`
|
||||||
|
DoubleStack bool `json:"double_stack" json:"double_stack"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LoginInfo struct {
|
type LoginInfo struct {
|
||||||
|
|||||||
@@ -93,16 +93,25 @@ func (c Srun) DoLogin(clientIP string) error {
|
|||||||
tokenStr + EncryptedInfo,
|
tokenStr + EncryptedInfo,
|
||||||
)
|
)
|
||||||
|
|
||||||
res, err = c.api.Login(
|
var doubleStack string
|
||||||
c.LoginInfo.Form.Username,
|
if c.LoginInfo.Meta.DoubleStack {
|
||||||
EncryptedMd5,
|
doubleStack = "1"
|
||||||
c.LoginInfo.Meta.Acid,
|
} else {
|
||||||
clientIP,
|
doubleStack = "0"
|
||||||
EncryptedInfo,
|
}
|
||||||
EncryptedChkstr,
|
res, err = c.api.Login(&LoginRequest{
|
||||||
c.LoginInfo.Meta.N,
|
Username: c.LoginInfo.Form.Username,
|
||||||
c.LoginInfo.Meta.Type,
|
Password: EncryptedMd5,
|
||||||
)
|
AcID: c.LoginInfo.Meta.Acid,
|
||||||
|
IP: clientIP,
|
||||||
|
Info: EncryptedInfo,
|
||||||
|
ChkSum: EncryptedChkstr,
|
||||||
|
N: c.LoginInfo.Meta.N,
|
||||||
|
Type: c.LoginInfo.Meta.Type,
|
||||||
|
OS: c.LoginInfo.Meta.OS,
|
||||||
|
Name: c.LoginInfo.Meta.Name,
|
||||||
|
DoubleStack: doubleStack,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user