This commit is contained in:
jiangyong27 2025-03-29 17:40:39 +08:00
parent a47d274b00
commit 5e0557ca3e
1 changed files with 3 additions and 3 deletions

View File

@ -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))