app.go 466 B

12345678910111213141516171819202122232425
  1. package http
  2. import (
  3. "go-common/library/ecode"
  4. "go-common/library/log"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. // Secret .
  8. func secret(c *bm.Context) {
  9. sappKey := c.Request.Form.Get("sappkey")
  10. if sappKey == "" {
  11. c.JSON(nil, ecode.RequestErr)
  12. log.Error("sappkey is empty")
  13. return
  14. }
  15. appSecret, err := openSvc.Secret(c, sappKey)
  16. if err != nil {
  17. c.JSON(nil, err)
  18. return
  19. }
  20. c.JSON(map[string]interface{}{
  21. "app_secret": appSecret,
  22. }, err)
  23. }