From 5e0557ca3e8e950d06fd9919b7e30fb0e97e4fa5 Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Sat, 29 Mar 2025 17:40:39 +0800 Subject: [PATCH] usrrole5 --- server/controller/calculator.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/controller/calculator.go b/server/controller/calculator.go index c3d2c46..eef7a35 100644 --- a/server/controller/calculator.go +++ b/server/controller/calculator.go @@ -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))