作者 yangfu

机会权限

@@ -417,32 +417,32 @@ func init() { @@ -417,32 +417,32 @@ func init() {
417 417
418 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 418 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
419 beego.ControllerComments{ 419 beego.ControllerComments{
420 - Method: "ChangePassword",  
421 - Router: `/changePassword`, 420 + Method: "Permission",
  421 + Router: `/chancePermission`,
422 AllowHTTPMethods: []string{"post"}, 422 AllowHTTPMethods: []string{"post"},
423 MethodParams: param.Make(), 423 MethodParams: param.Make(),
424 Params: nil}) 424 Params: nil})
425 425
426 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 426 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
427 beego.ControllerComments{ 427 beego.ControllerComments{
428 - Method: "ChangePhone",  
429 - Router: `/changePhone`, 428 + Method: "ChangePassword",
  429 + Router: `/changePassword`,
430 AllowHTTPMethods: []string{"post"}, 430 AllowHTTPMethods: []string{"post"},
431 MethodParams: param.Make(), 431 MethodParams: param.Make(),
432 Params: nil}) 432 Params: nil})
433 433
434 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 434 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
435 beego.ControllerComments{ 435 beego.ControllerComments{
436 - Method: "CheckSmsCode",  
437 - Router: `/checkSmsCode`, 436 + Method: "ChangePhone",
  437 + Router: `/changePhone`,
438 AllowHTTPMethods: []string{"post"}, 438 AllowHTTPMethods: []string{"post"},
439 MethodParams: param.Make(), 439 MethodParams: param.Make(),
440 Params: nil}) 440 Params: nil})
441 441
442 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"], 442 beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
443 beego.ControllerComments{ 443 beego.ControllerComments{
444 - Method: "Permission",  
445 - Router: `/permission`, 444 + Method: "CheckSmsCode",
  445 + Router: `/checkSmsCode`,
446 AllowHTTPMethods: []string{"post"}, 446 AllowHTTPMethods: []string{"post"},
447 MethodParams: param.Make(), 447 MethodParams: param.Make(),
448 Params: nil}) 448 Params: nil})
@@ -261,17 +261,18 @@ func getUserPermission(userCompanyid int64) (map[string]PermissionOptionObject, @@ -261,17 +261,18 @@ func getUserPermission(userCompanyid int64) (map[string]PermissionOptionObject,
261 Code string `orm:"column(code)"` 261 Code string `orm:"column(code)"`
262 Opption string `orm:"column(opption)"` 262 Opption string `orm:"column(opption)"`
263 } 263 }
264 - const datasql string = `SELECT a.code,a.opption 264 + var datasql string = fmt.Sprintf(`SELECT a.code,a.opption
265 FROM role_menu AS a 265 FROM role_menu AS a
266 JOIN user_role AS b ON a.role_id = b.role_id 266 JOIN user_role AS b ON a.role_id = b.role_id
267 JOIN role AS c ON a.role_id = c.id 267 JOIN role AS c ON a.role_id = c.id
268 - WHERE a.code=? AND b.user_company_id=? AND c.delete_at =0` 268 + WHERE a.code='%v' AND b.user_company_id=? AND c.delete_at =0`, M_SYSTEM_OPPORTUNITY)
  269 +
269 var ( 270 var (
270 data []CodeOpptionData 271 data []CodeOpptionData
271 err error 272 err error
272 objMap = make(map[string]PermissionOptionObject) 273 objMap = make(map[string]PermissionOptionObject)
273 ) 274 )
274 - err = utils.ExecuteQueryAll(&data, datasql, M_SYSTEM_OPPORTUNITY, userCompanyid) 275 + err = utils.ExecuteQueryAll(&data, datasql, userCompanyid)
275 if err != nil { 276 if err != nil {
276 e := fmt.Errorf("EXCUTE SQL ERR:%s", err) 277 e := fmt.Errorf("EXCUTE SQL ERR:%s", err)
277 return nil, e 278 return nil, e