Skip to content

Commit

Permalink
新增ApiCode.Ok200,200成功。一般用于Http响应,也有部分JsonRpc使用该响应码表示成功
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Mar 31, 2024
1 parent 6da909d commit c8ca1c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NewLife.Core/Remoting/ApiCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ public class ApiCode
/// <summary>成功</summary>
public const Int32 Ok = 0;

/// <summary>200成功。一般用于Http响应,也有部分JsonRpc使用该响应码表示成功</summary>
public const Int32 Ok200 = 200;

/// <summary>未经许可。一般是指未登录</summary>
public const Int32 Unauthorized = 401;

Expand Down
2 changes: 1 addition & 1 deletion NewLife.Core/Remoting/ApiHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public static HttpContent BuildContent(Packet pk)
}
}
}
if (code is not ApiCode.Ok and not 200)
if (code is not ApiCode.Ok and not ApiCode.Ok200)
{
var message = "";
foreach (var item in MessageNames)
Expand Down

0 comments on commit c8ca1c5

Please sign in to comment.