作者 yangfu

机会权限

... ... @@ -417,32 +417,32 @@ func init() {
beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
beego.ControllerComments{
Method: "ChangePassword",
Router: `/changePassword`,
Method: "Permission",
Router: `/chancePermission`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Params: nil})
beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
beego.ControllerComments{
Method: "ChangePhone",
Router: `/changePhone`,
Method: "ChangePassword",
Router: `/changePassword`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Params: nil})
beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
beego.ControllerComments{
Method: "CheckSmsCode",
Router: `/checkSmsCode`,
Method: "ChangePhone",
Router: `/changePhone`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Params: nil})
beego.GlobalControllerRouter["opp/controllers/v1:UserController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:UserController"],
beego.ControllerComments{
Method: "Permission",
Router: `/permission`,
Method: "CheckSmsCode",
Router: `/checkSmsCode`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Params: nil})
... ...
... ... @@ -261,17 +261,18 @@ func getUserPermission(userCompanyid int64) (map[string]PermissionOptionObject,
Code string `orm:"column(code)"`
Opption string `orm:"column(opption)"`
}
const datasql string = `SELECT a.code,a.opption
var datasql string = fmt.Sprintf(`SELECT a.code,a.opption
FROM role_menu AS a
JOIN user_role AS b ON a.role_id = b.role_id
JOIN role AS c ON a.role_id = c.id
WHERE a.code=? AND b.user_company_id=? AND c.delete_at =0`
WHERE a.code='%v' AND b.user_company_id=? AND c.delete_at =0`, M_SYSTEM_OPPORTUNITY)
var (
data []CodeOpptionData
err error
objMap = make(map[string]PermissionOptionObject)
)
err = utils.ExecuteQueryAll(&data, datasql, M_SYSTEM_OPPORTUNITY, userCompanyid)
err = utils.ExecuteQueryAll(&data, datasql, userCompanyid)
if err != nil {
e := fmt.Errorf("EXCUTE SQL ERR:%s", err)
return nil, e
... ...