Update login.go
This commit is contained in:
parent
7dc5608441
commit
58c3e7919c
@ -491,9 +491,10 @@ func (c *LoginController) CkLogin() {
|
||||
func (c *LoginController) SMSLogin() {
|
||||
cookie := c.GetString("ck")
|
||||
qq := c.GetString("qq")
|
||||
token := c.GetString("token")
|
||||
logs.Info(cookie)
|
||||
(&models.JdCookie{}).Push(cookie)
|
||||
|
||||
if token == models.Config.ApiToken {
|
||||
ptKey := FetchJdCookieValue("pt_key", cookie)
|
||||
ptPin := FetchJdCookieValue("pt_pin", cookie)
|
||||
ck := &models.JdCookie{
|
||||
@ -511,7 +512,7 @@ func (c *LoginController) SMSLogin() {
|
||||
models.NewJdCookie(ck)
|
||||
ck.Query()
|
||||
if qq != "" {
|
||||
msg := fmt.Sprintf("来自短信的添加,账号:%s,QQ: %s", ck.PtPin, qq)
|
||||
msg := fmt.Sprintf("来自短信的添加,账号:%s,QQ: %v", ck.PtPin, qq)
|
||||
(&models.JdCookie{}).Push(msg)
|
||||
} else {
|
||||
msg := fmt.Sprintf("来自短信的添加,账号:%s", ck.PtPin)
|
||||
@ -523,7 +524,7 @@ func (c *LoginController) SMSLogin() {
|
||||
if qq != "" && len(qq) > 6 {
|
||||
ck.Update(models.QQ, qq)
|
||||
}
|
||||
msg := fmt.Sprintf("来自短信的更新,账号:%s", ck.PtPin)
|
||||
msg := fmt.Sprintf("来自短信的更新,账号:%s,QQ: %v", ck.PtPin,qq)
|
||||
(&models.JdCookie{}).Push(msg)
|
||||
}
|
||||
|
||||
@ -566,7 +567,20 @@ func (c *LoginController) SMSLogin() {
|
||||
(&models.JdCookie{}).Push(msg)
|
||||
c.Ctx.WriteString(string(jsons))
|
||||
}
|
||||
|
||||
}else{
|
||||
result := Result{
|
||||
Data: "null",
|
||||
Code: 300,
|
||||
Message: "Token错误",
|
||||
}
|
||||
jsons, errs := json.Marshal(result) //转换成JSON返回的是byte[]
|
||||
if errs != nil {
|
||||
fmt.Println(errs.Error())
|
||||
}
|
||||
msg := fmt.Sprintf("传入错误Token,请小心攻击")
|
||||
(&models.JdCookie{}).Push(msg)
|
||||
c.Ctx.WriteString(string(jsons))
|
||||
}
|
||||
}
|
||||
|
||||
func (c *LoginController) Cookie() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user