http.go 678 B

1234567891011121314151617181920212223242526272829
  1. package dao
  2. import (
  3. "context"
  4. "net/url"
  5. "strconv"
  6. "go-common/library/log"
  7. )
  8. const (
  9. _doubleCheckURL = "http://passport.bilibili.co/intranet/acc/security/mid"
  10. )
  11. // DoubleCheck notify passport to remove login.
  12. func (d *Dao) DoubleCheck(c context.Context, mid int64) (err error) {
  13. params := url.Values{}
  14. params.Set("mids", strconv.FormatInt(mid, 10))
  15. params.Set("desc", "异地风险,系统导入")
  16. params.Set("operator", "异地系统判断")
  17. var res struct {
  18. Code int `json:"code"`
  19. }
  20. if err = d.httpClient.Post(c, _doubleCheckURL, "", params, &res); err != nil {
  21. log.Error("d.Doublecheck err(%v)", err)
  22. }
  23. log.Info("d.DoubleCheck mid %d ", mid)
  24. return
  25. }