Refactor error handling in services to use internationalized error messages
- Updated OSSStorage validation errors to use internationalized messages. - Changed error messages in provider.go for unsupported file storage types. - Refactored tag_service.go to replace hardcoded error messages with internationalized versions. - Updated ticket_service.go to use internationalized error messages for various validation checks. - Refactored ticket_tag_service.go to use internationalized error messages for tag validation. - Changed ticket_view_service.go to use internationalized error messages for view validation. - Updated tool_catalog_service.go to use internationalized error messages for tool code validation. - Refactored user_service.go to replace error messages with internationalized versions. - Updated ws_service.go to use internationalized error messages for WebSocket handling. - Refactored wxwork_kf_inbound_service.go to use internationalized error messages for message handling. - Updated wxwork_kf_outbound_service.go to use internationalized error messages for outbound message handling. - Refactored wxwork_login_service.go to use internationalized error messages for login handling. - Updated login.go in wxwork package to use internationalized error messages for login state and ticket validation.
This commit is contained in:
@@ -68,7 +68,7 @@ func UserGetBy(ctx *gin.Context) {
|
||||
|
||||
item := services.UserService.Get(id)
|
||||
if item == nil {
|
||||
httpx.WriteJSON(ctx, web.JsonErrorMsg("用户不存在"))
|
||||
httpx.WriteJSON(ctx, httpx.JsonErrorMsg(ctx, "error.e0255"))
|
||||
return
|
||||
}
|
||||
httpx.WriteJSON(ctx, builders.BuildUserResponse(item, builders.UserBuildOptions{
|
||||
@@ -191,7 +191,7 @@ func UserPostChange_password(ctx *gin.Context) {
|
||||
principal = services.AuthService.GetAuthPrincipal(ctx)
|
||||
}
|
||||
if principal == nil {
|
||||
httpx.WriteJSON(ctx, web.JsonErrorMsg("未登录或登录已过期"))
|
||||
httpx.WriteJSON(ctx, httpx.JsonErrorMsg(ctx, "error.auth.expired"))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user