Skip to content

Commit

Permalink
[feat]支持假删除以及数据恢复
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Jul 25, 2024
1 parent ee3324a commit 6cf4222
Show file tree
Hide file tree
Showing 13 changed files with 365 additions and 239 deletions.
2 changes: 1 addition & 1 deletion NewLife.Cube/Common/OAuthController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public TokenModel Token([FromBody] TokenInModel model)
var (jwt, ex) = _tokenService.DecodeTokenWithError(model.refresh_token, set.JwtSecret);

// 验证应用
var app = App.FindByName(jwt?.Subject);
var app = _tokenService.FindByName(jwt?.Subject);
if (app == null || !app.Enable)
ex ??= new ApiException(403, $"无效应用[{jwt.Subject}]");

Expand Down
22 changes: 22 additions & 0 deletions NewLife.Cube/Entity/Cube.htm
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,17 @@ <h3>OAuth配置(OAuthConfig)</h3>
<td>是否抓取头像并保存到本地</td>
</tr>

<tr>
<td>IsDeleted</td>
<td>删除</td>
<td>Boolean</td>
<td></td>
<td></td>
<td></td>
<td>N</td>
<td>是否已删除,可恢复</td>
</tr>

<tr>
<td>CreateUserID</td>
<td>创建者</td>
Expand Down Expand Up @@ -1713,6 +1724,17 @@ <h3>应用系统(OAuthApp)</h3>
<td></td>
</tr>

<tr>
<td>IsDeleted</td>
<td>删除</td>
<td>Boolean</td>
<td></td>
<td></td>
<td></td>
<td>N</td>
<td>是否已删除,可恢复</td>
</tr>

<tr>
<td>CreateUserID</td>
<td>创建者</td>
Expand Down
2 changes: 2 additions & 0 deletions NewLife.Cube/Entity/Cube.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
<Column Name="SecurityKey" DataType="String" Length="500" Description="安全密钥。公钥,用于RSA加密用户密码,在通信链路上保护用户密码安全,密钥前面可以增加keyName,形成keyName$keyValue,用于向服务端指示所使用的密钥标识,方便未来更换密钥。" />
<Column Name="FieldMap" DataType="String" Length="500" Description="字段映射。SSO用户字段如何映射到OAuthClient内部属性" />
<Column Name="FetchAvatar" DataType="Boolean" Description="抓取头像。是否抓取头像并保存到本地" />
<Column Name="IsDeleted" DataType="Boolean" Description="删除。是否已删除,可恢复" />
<Column Name="CreateUserID" DataType="Int32" Description="创建者" Category="扩展" />
<Column Name="CreateTime" DataType="DateTime" Description="创建时间" Category="扩展" />
<Column Name="CreateIP" DataType="String" Description="创建地址" Category="扩展" />
Expand Down Expand Up @@ -234,6 +235,7 @@
<Column Name="Expired" DataType="DateTime" Description="过期时间。空表示永不过期" />
<Column Name="Auths" DataType="Int32" Description="次数" />
<Column Name="LastAuth" DataType="DateTime" Description="最后请求" />
<Column Name="IsDeleted" DataType="Boolean" Description="删除。是否已删除,可恢复" />
<Column Name="CreateUserID" DataType="Int32" Description="创建者" Category="扩展" />
<Column Name="CreateTime" DataType="DateTime" Description="创建时间" Category="扩展" />
<Column Name="CreateIP" DataType="String" Description="创建地址" Category="扩展" />
Expand Down
Loading

0 comments on commit 6cf4222

Please sign in to comment.