style: 修改包名

This commit is contained in:
Mmx
2021-11-25 09:16:31 +08:00
parent 2c3c694065
commit ca9436c6a6
7 changed files with 18 additions and 18 deletions

View File

@@ -7,12 +7,12 @@ import (
) )
func Login(output bool, skipCheck bool) error { func Login(output bool, skipCheck bool) error {
return BitSrun.Login(&transfer.Login{ return BitSrun.Login(&srunTransfer.Login{
Demo: global.Config.Settings.DemoMode, Demo: global.Config.Settings.DemoMode,
OutPut: output, OutPut: output,
CheckNet: !skipCheck, CheckNet: !skipCheck,
Timeout: global.Config.Settings.Timeout, Timeout: global.Config.Settings.Timeout,
LoginInfo: transfer.LoginInfo{ LoginInfo: srunTransfer.LoginInfo{
Form: &global.Config.Form, Form: &global.Config.Form,
Meta: &global.Config.Meta, Meta: &global.Config.Meta,
}, },

View File

@@ -8,7 +8,7 @@ import (
"os" "os"
) )
var Config models.Config var Config srunModels.Config
func init() { func init() {
initFlags() initFlags()
@@ -16,23 +16,23 @@ func init() {
//配置文件初始化 //配置文件初始化
if e := config.Load(config.Options{ if e := config.Load(config.Options{
Config: &Config, Config: &Config,
Default: &models.Config{ Default: &srunModels.Config{
Form: models.LoginForm{ Form: srunModels.LoginForm{
Domain: "www.msftconnecttest.com", Domain: "www.msftconnecttest.com",
UserType: "cmcc", UserType: "cmcc",
}, },
Meta: models.LoginMeta{ Meta: srunModels.LoginMeta{
N: "200", N: "200",
Type: "1", Type: "1",
Acid: "5", Acid: "5",
Enc: "srun_bx1", Enc: "srun_bx1",
}, },
Settings: models.Settings{ Settings: srunModels.Settings{
Timeout: 1, Timeout: 1,
Daemon: models.Daemon{ Daemon: srunModels.Daemon{
Path: ".autoLogin", Path: ".autoLogin",
}, },
Guardian: models.Guardian{ Guardian: srunModels.Guardian{
Duration: 300, Duration: 300,
}, },
}, },

View File

@@ -1,4 +1,4 @@
package models package srunModels
type Daemon struct { type Daemon struct {
Enable bool `json:"enable"` Enable bool `json:"enable"`

View File

@@ -1,4 +1,4 @@
package models package srunModels
type LoginForm struct { type LoginForm struct {
Domain string `json:"domain"` Domain string `json:"domain"`

View File

@@ -2,14 +2,14 @@ package util
import "github.com/Mmx233/BitSrunLoginGo/models" import "github.com/Mmx233/BitSrunLoginGo/models"
func GenerateLoginInfo(Form *models.LoginForm, Meta *models.LoginMeta) *models.LoginInfo { func GenerateLoginInfo(Form *srunModels.LoginForm, Meta *srunModels.LoginMeta) *srunModels.LoginInfo {
return &models.LoginInfo{ return &srunModels.LoginInfo{
UrlLoginPage: "http://" + Form.Domain + "/srun_portal_success", UrlLoginPage: "http://" + Form.Domain + "/srun_portal_success",
UrlGetChallengeApi: "http://" + Form.Domain + "/cgi-bin/get_challenge", UrlGetChallengeApi: "http://" + Form.Domain + "/cgi-bin/get_challenge",
UrlLoginApi: "http://" + Form.Domain + "/cgi-bin/srun_portal", UrlLoginApi: "http://" + Form.Domain + "/cgi-bin/srun_portal",
UrlCheckApi: "http://" + Form.Domain + "/cgi-bin/rad_user_info", UrlCheckApi: "http://" + Form.Domain + "/cgi-bin/rad_user_info",
Meta: Meta, Meta: Meta,
Form: &models.LoginForm{ Form: &srunModels.LoginForm{
UserName: Form.UserName + "@" + Form.UserType, UserName: Form.UserName + "@" + Form.UserType,
PassWord: Form.PassWord, PassWord: Form.PassWord,
}, },

View File

@@ -9,7 +9,7 @@ import (
"time" "time"
) )
func Login(c *transfer.Login) error { func Login(c *srunTransfer.Login) error {
util.Log.Demo = c.Demo util.Log.Demo = c.Demo
util.Log.OutPut = c.OutPut util.Log.OutPut = c.OutPut

View File

@@ -1,10 +1,10 @@
package transfer package srunTransfer
import "github.com/Mmx233/BitSrunLoginGo/models" import "github.com/Mmx233/BitSrunLoginGo/models"
type LoginInfo struct { type LoginInfo struct {
Form *models.LoginForm Form *srunModels.LoginForm
Meta *models.LoginMeta Meta *srunModels.LoginMeta
} }
type Login struct { type Login struct {