improve: 实装嗅探 acid

This commit is contained in:
Mmx233
2023-06-04 20:49:28 +08:00
parent af3b4d6439
commit 83795db39e
4 changed files with 23 additions and 10 deletions

View File

@@ -81,7 +81,6 @@ func (a *Api) GetUserInfo() (map[string]interface{}, error) {
// DetectAcid error 为 nil 的情况下 acid 可能为空
func (a *Api) DetectAcid() (string, error) {
fmt.Println("开始嗅探 Acid")
addr := a.BaseUrl
for {
log.Debugln("HTTP GET ", addr)

View File

@@ -30,7 +30,7 @@ type Srun struct {
api Api
}
func (c *Srun) LoginStatus() (online bool, ip string, e error) {
func (c Srun) LoginStatus() (online bool, ip string, e error) {
res, e := c.api.GetUserInfo()
if e != nil {
return false, "", e
@@ -59,7 +59,7 @@ func (c *Srun) LoginStatus() (online bool, ip string, e error) {
return
}
func (c *Srun) DoLogin(clientIP string) error {
func (c Srun) DoLogin(clientIP string) error {
log.Debugln("正在获取 Token")
if c.LoginInfo.Form.UserType != "" {
@@ -125,3 +125,7 @@ func (c *Srun) DoLogin(clientIP string) error {
return nil
}
func (c Srun) DetectAcid() (string, error) {
return c.api.DetectAcid()
}