usrrole5
This commit is contained in:
parent
a47d274b00
commit
5e0557ca3e
|
@ -27,7 +27,7 @@ func (c *Calculator) Create(ctx *gin.Context) {
|
|||
ctx.Keys[session.ContextRequest] = req
|
||||
|
||||
if !sess.GetAdmin().GetConfig().IsAdmin() {
|
||||
panic(config.ErrParam.New())
|
||||
panic(config.ErrPriv.New())
|
||||
}
|
||||
calculator := new(model.SalaryCalculator)
|
||||
calculator.CorpId = sess.GetAdmin().CorpId
|
||||
|
@ -45,7 +45,7 @@ func (c *Calculator) Update(ctx *gin.Context) {
|
|||
session.CheckParamError(ctx.ShouldBindJSON(&req))
|
||||
ctx.Keys[session.ContextRequest] = req
|
||||
if !sess.GetAdmin().GetConfig().IsAdmin() {
|
||||
panic(config.ErrParam.New())
|
||||
panic(config.ErrPriv.New())
|
||||
}
|
||||
calculator, err := dao.NewSalaryCalculatorDao().Get(cast.ToInt64(req.Id))
|
||||
session.CheckDBError(err)
|
||||
|
@ -63,7 +63,7 @@ func (c *Calculator) Update(ctx *gin.Context) {
|
|||
func (c *Calculator) Delete(ctx *gin.Context) {
|
||||
sess := ctx.Keys[session.ContextSession].(*session.AdminSession)
|
||||
if !sess.GetAdmin().GetConfig().IsAdmin() {
|
||||
panic(config.ErrParam.New())
|
||||
panic(config.ErrPriv.New())
|
||||
}
|
||||
id := cast.ToInt64(ctx.Query("id"))
|
||||
session.CheckDBError(dao.NewSalaryCalculatorDao().Delete(id))
|
||||
|
|
Loading…
Reference in New Issue