commonAction.go 597 B

123456789101112131415161718192021222324252627282930
  1. package common
  2. import (
  3. "github.com/gogf/gf/frame/g"
  4. "github.com/gogf/gf/net/ghttp"
  5. "github.com/gogf/gf/os/glog"
  6. "gmanager/app/constants"
  7. )
  8. // Login 登录页面
  9. func Welcome(r *ghttp.Request) {
  10. err := r.Response.WriteTpl("pages/welcome.html", g.Map{})
  11. if err != nil {
  12. glog.Error(err)
  13. }
  14. }
  15. // 调试页面
  16. func Debug(r *ghttp.Request) {
  17. if constants.DEBUG {
  18. constants.DEBUG = false
  19. g.DB().SetDebug(false)
  20. r.Response.Writeln("debug close ~!~ ")
  21. } else {
  22. constants.DEBUG = true
  23. g.DB().SetDebug(true)
  24. r.Response.Writeln("debug open ~!~ ")
  25. }
  26. }