csx 4 vuotta sitten
vanhempi
commit
5546bb4635
2 muutettua tiedostoa jossa 11 lisäystä ja 8 poistoa
  1. 3 0
      conf/app.conf
  2. 8 8
      controllers/base_api_controller.go

+ 3 - 0
conf/app.conf Näytä tiedosto

@@ -147,6 +147,9 @@ sso_domain = https://testsso.sgjyun.com
147 147
 call_domain = http://hf.szjkhd.com
148 148
 front_end_domain = "http://xt.test.sgjyun.com/#"
149 149
 
150
+org_id = 9919
151
+
152
+
150 153
 readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
151 154
 readmysqlport = 3306
152 155
 readmysqluser = root

+ 8 - 8
controllers/base_api_controller.go Näytä tiedosto

@@ -3,12 +3,12 @@ package controllers
3 3
 import (
4 4
 	"gdyb/enums"
5 5
 	"gdyb/models"
6
+	"github.com/astaxie/beego"
6 7
 
7 8
 	//"XT_New/models"
8 9
 
9 10
 	//"XT_New/models"
10 11
 	"gdyb/service"
11
-
12 12
 )
13 13
 
14 14
 type BaseAPIController struct {
@@ -67,6 +67,7 @@ type BaseAuthAPIController struct {
67 67
 func (this *BaseAuthAPIController) Prepare() {
68 68
 	this.BaseAPIController.Prepare()
69 69
 	if this.GetAdminUserInfo() == nil {
70
+		org_id, _ := beego.AppConfig.Int64("org_id")
70 71
 		var userAdmin models.AdminUser
71 72
 		userAdmin.Id = 1448
72 73
 		userAdmin.Mobile = "13318599895"
@@ -79,7 +80,7 @@ func (this *BaseAuthAPIController) Prepare() {
79 80
 		userAdmin.ModifyTime = 1530786071
80 81
 		var subscibe models.ServeSubscibe
81 82
 		subscibe.ID = 1
82
-		subscibe.OrgId = 4
83
+		subscibe.OrgId = org_id
83 84
 		subscibe.PeriodStart = 1538035409
84 85
 		subscibe.PeriodEnd = 1569571409
85 86
 		subscibe.State = 1
@@ -89,7 +90,7 @@ func (this *BaseAuthAPIController) Prepare() {
89 90
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
90 91
 		subscibes[4] = &subscibe
91 92
 		var adminUserInfo service.AdminUserInfo
92
-		adminUserInfo.CurrentOrgId = 4
93
+		adminUserInfo.CurrentOrgId = org_id
93 94
 		adminUserInfo.CurrentAppId = 8642
94 95
 		adminUserInfo.AdminUser = &userAdmin
95 96
 
@@ -100,8 +101,6 @@ func (this *BaseAuthAPIController) Prepare() {
100 101
 
101 102
 	}
102 103
 
103
-
104
-
105 104
 	//if this.Ctx.Request.Method != "GET" {
106 105
 	//	adminUserInfo := this.GetAdminUserInfo()
107 106
 	//
@@ -185,6 +184,8 @@ type BaseServeAPIController struct {
185 184
 func (this *BaseServeAPIController) Prepare() {
186 185
 	this.BaseAPIController.Prepare()
187 186
 	if this.GetAdminUserInfo() == nil {
187
+		org_id, _ := beego.AppConfig.Int64("org_id")
188
+
188 189
 		var userAdmin models.AdminUser
189 190
 		userAdmin.Id = 1448
190 191
 		userAdmin.Mobile = "13318599895"
@@ -197,7 +198,7 @@ func (this *BaseServeAPIController) Prepare() {
197 198
 		userAdmin.ModifyTime = 1530786071
198 199
 		var subscibe models.ServeSubscibe
199 200
 		subscibe.ID = 1
200
-		subscibe.OrgId = 4
201
+		subscibe.OrgId = org_id
201 202
 		subscibe.PeriodStart = 1538035409
202 203
 		subscibe.PeriodEnd = 1569571409
203 204
 		subscibe.State = 1
@@ -207,8 +208,7 @@ func (this *BaseServeAPIController) Prepare() {
207 208
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
208 209
 		subscibes[4] = &subscibe
209 210
 		var adminUserInfo service.AdminUserInfo
210
-		adminUserInfo.CurrentOrgId = 4
211
-		adminUserInfo.CurrentAppId = 8642
211
+		adminUserInfo.CurrentOrgId = org_id
212 212
 		adminUserInfo.AdminUser = &userAdmin
213 213
 		this.SetSession("admin_user_info", &adminUserInfo)
214 214
 		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)