陈少旭 4 месяцев назад
Родитель
Сommit
ebb05c4d4c

+ 4 - 0
controllers/admin_api_controllers/admin_api_base_controller.go Просмотреть файл

@@ -4,6 +4,7 @@ import (
4 4
 	"XT_Admin_Api/controllers"
5 5
 	"XT_Admin_Api/enums"
6 6
 	"XT_Admin_Api/models/admin_models"
7
+	"fmt"
7 8
 )
8 9
 
9 10
 type AdminBaseAPIController struct {
@@ -32,6 +33,8 @@ func (this *AdminBaseAPIController) TraceLog(format string, a ...interface{}) {
32 33
 
33 34
 func (this *AdminBaseAPIController) GetAdminInfo() *AdminInfo {
34 35
 	userInfo := this.GetSession("admin_info")
36
+	fmt.Println(userInfo)
37
+
35 38
 	if userInfo == nil {
36 39
 		return nil
37 40
 	} else {
@@ -50,6 +53,7 @@ type AdminBaseAPIAuthController struct {
50 53
 func (this *AdminBaseAPIAuthController) Prepare() {
51 54
 	this.AdminBaseAPIController.Prepare()
52 55
 	adminInfo := this.GetAdminInfo()
56
+	fmt.Println(adminInfo)
53 57
 	if adminInfo == nil {
54 58
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
55 59
 		this.StopRun()

+ 1 - 1
controllers/admin_api_controllers/admin_api_router_register.go Просмотреть файл

@@ -17,7 +17,7 @@ func AdminAPIControllersRegisterRouters() {
17 17
 	beego.Router("/admin/api/custom/edit", &CustomAPIController{}, "post:ModifyCustom")
18 18
 	beego.Router("/admin/api/custom/list", &CustomAPIController{}, "get:GetCustomList")
19 19
 	beego.Router("/admin/api/custom/get", &CustomAPIController{}, "get:GetCustom")
20
-	beego.Router("/admin/api/checkcustom/get", &CustomAPIController{}, "get:GetWaitCheckCustom")
20
+	//beego.Router("/admin/api/checkcustom/get", &CustomAPIController{}, "get:GetWaitCheckCustom")
21 21
 
22 22
 	beego.Router("/admin/api/paymentcollection/create", &CustomAPIController{}, "post:CreatePaymentCollection")
23 23
 	beego.Router("/admin/api/paymentcollection/get", &CustomAPIController{}, "get:GetPaymentCollection")

+ 3 - 0
controllers/admin_api_controllers/login_api_controller.go Просмотреть файл

@@ -3,6 +3,7 @@ package admin_api_controllers
3 3
 import (
4 4
 	"XT_Admin_Api/enums"
5 5
 	"XT_Admin_Api/service"
6
+	"fmt"
6 7
 )
7 8
 
8 9
 type LoginAPIController struct {
@@ -29,6 +30,8 @@ func (this *LoginAPIController) LoginByPwd() {
29 30
 	this.SetSession("admin_info", &AdminInfo{
30 31
 		Admin: admin,
31 32
 	})
33
+	//userInfo := this.GetSession("admin_info")
34
+	fmt.Println(this.GetSession("admin_info"))
32 35
 	this.ServeSuccessJSON(map[string]interface{}{
33 36
 		"admin": admin,
34 37
 	})

+ 5 - 0
main.go Просмотреть файл

@@ -3,12 +3,17 @@ package main
3 3
 import (
4 4
 	_ "XT_Admin_Api/routers"
5 5
 	"XT_Admin_Api/service"
6
+	"net/http"
6 7
 
7 8
 	"github.com/astaxie/beego"
9
+	_ "net/http/pprof"
8 10
 )
9 11
 
10 12
 func init() {
11 13
 	service.ConnectDB()
14
+	go func() {
15
+		http.ListenAndServe("localhost:6060", nil)
16
+	}()
12 17
 }
13 18
 
14 19
 func main() {