作者 唐旭辉

bug fix

... ... @@ -103,6 +103,14 @@ func (c *AuthController) LoginSms() {
}
logintoken, err := serveauth.LoginAuthBySmsCode(param.Account, param.Code)
err = serveauth.ResetLoginToken(logintoken)
if err != nil {
log.Error("token 信息记录数据库失败")
}
err = serveauth.ResetLoginTokenRedis(logintoken)
if err != nil {
log.Error("token 信息记录redis失败")
}
data := protocol.ResponseLogin{
Access: logintoken,
}
... ...
... ... @@ -479,6 +479,7 @@ func UserDelete(userCompanyids []int64, companyid int64) error {
Filter("id__in", ids).
Update(orm.Params{
"delete_at": time.Now().String(),
"enable": models.USERCOMPANY_ENABLE_NO,
})
if err != nil {
e := fmt.Errorf("UserDelete err:%s", err)
... ...
... ... @@ -35,7 +35,30 @@ type PermissionBase struct {
ActionName string
}
var routerPermission = map[string]PermissionBase{}
var routerPermission = map[string]PermissionBase{
"/v1/department/list": PermissionBase{CodeName: M_ENTERPRISE_ORGANIZATION, ActionName: "default"},
"/v1/department/add": PermissionBase{CodeName: M_ENTERPRISE_ORGANIZATION, ActionName: "default"},
"/v1/department/edit": PermissionBase{CodeName: M_ENTERPRISE_ORGANIZATION, ActionName: "default"},
"/v1/department/delete": PermissionBase{CodeName: M_ENTERPRISE_ORGANIZATION, ActionName: "default"},
"/v1/company/current/edit": PermissionBase{CodeName: M_ENTERPRISE_PROFILE, ActionName: "default"},
"/v1/company/current/info": PermissionBase{CodeName: M_ENTERPRISE_PROFILE, ActionName: "default"},
"/v1/position/list": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_POST, ActionName: "default"},
"/v1/position/add": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_POST, ActionName: "default"},
"/v1/position/edit": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_POST, ActionName: "default"},
"/v1/position/delete": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_POST, ActionName: "default"},
"/v1/rbac/role/list": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/role/add": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/role/edit": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/role/delete": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/role_group/add": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/role_group/edit": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/role_group/delete": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/menu/list": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/menu": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/menu/edit": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/menu/opportunity": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
"/v1/rbac/menu/opportunity/edit": PermissionBase{CodeName: M_ENTERPRISE_EMPLOYEE_ROLE, ActionName: "default"},
}
type CodeToObject func() PermissionOptionObject
... ...