Skip to content

Commit 041f3ee

Browse files
nsnailtk
andauthored
chore: 🔨 框架代码同步 (#343)
Co-authored-by: tk <fiyne1a@dingtalk.com>
1 parent 1650b8a commit 041f3ee

25 files changed

Lines changed: 184 additions & 83 deletions

File tree

assets/res/NetAdmin.Fields.ln

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ USDT
4141
响应体
4242
响应状态码
4343
唯一编码
44-
处理中
4544
备注
4645
外国人居留证
4746
外部错误
@@ -59,14 +58,12 @@ USDT
5958
已冻结
6059
已发送
6160
已婚
62-
已完成
6361
已校验
6462
已解冻
6563
已读
6664
并且
6765
归属角色
6866
归属部门
69-
待执行
7067
微信支付
7168
成功
7269
或者
@@ -101,7 +98,6 @@ USDT
10198
最后登录时间
10299
未处理异常
103100
未婚
104-
未结算
105101
未读
106102
本人数据
107103
本科
@@ -116,7 +112,6 @@ USDT
116112
消息类型
117113
港澳台通行证
118114
用户代理
119-
用户取消
120115
用户名
121116
用户导出
122117
用户邀请导出
@@ -133,6 +128,7 @@ USDT
133128
等于
134129
等待发送
135130
等待支付
131+
管理员充值
136132
管理员扣费
137133
管理员赠送
138134
管理模块

assets/res/NetAdmin.Statements.ln

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ XML注释文件不存在
6161
未指定部门
6262
未获取到待执行任务
6363
档案可见性不正确
64+
此操作不被允许
6465
此节点已下线
6566
民族不正确
6667
消息主题不能为空
@@ -100,7 +101,6 @@ XML注释文件不存在
100101
请求地址不能为空
101102
请求对象不能为空
102103
请求方法不正确
103-
请稍后重试
104104
请联系管理员激活账号
105105
读取用户令牌出错
106106
账号不能为空
@@ -116,7 +116,6 @@ XML注释文件不存在
116116
随机延时结束时间不正确
117117
随机延时起始时间不正确
118118
非JSON字符串
119-
此操作不被允许
120119
验证数据不能为空
121120
验证码不正确
122121
验证码不能为空
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
示例导出

src/backend/NetAdmin/NetAdmin.Infrastructure/Enums/AdminTradeTypes.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public enum AdminTradeTypes
1111
/// </summary>
1212
[ResourceDescription<Ln>(nameof(Ln.管理员赠送))]
1313
[Trade(Direction = TradeDirections.Income)]
14-
AdminDeposit = 1
14+
AdminGift = 1
1515

1616
,
1717

@@ -21,4 +21,13 @@ public enum AdminTradeTypes
2121
[ResourceDescription<Ln>(nameof(Ln.管理员扣费))]
2222
[Trade(Direction = TradeDirections.Expense)]
2323
AdminDeduct = 2
24+
25+
,
26+
27+
/// <summary>
28+
/// 管理员充值
29+
/// </summary>
30+
[ResourceDescription<Ln>(nameof(Ln.管理员充值))]
31+
[Trade(Direction = TradeDirections.Income)]
32+
AdminDeposit = 6
2433
}

src/backend/NetAdmin/NetAdmin.Infrastructure/Enums/TradeTypes.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public enum TradeTypes
1111
/// </summary>
1212
[ResourceDescription<Ln>(nameof(Ln.管理员赠送))]
1313
[Trade(Direction = TradeDirections.Income)]
14-
AdminDeposit = 1
14+
AdminGift = 1
1515

1616
,
1717

@@ -47,5 +47,12 @@ public enum TradeTypes
4747
/// </summary>
4848
[ResourceDescription<Ln>(nameof(Ln.转账收入))]
4949
[Trade(Direction = TradeDirections.Income)]
50-
TransferIncome = 5
50+
TransferIncome = 5,
51+
52+
/// <summary>
53+
/// 管理员充值
54+
/// </summary>
55+
[ResourceDescription<Ln>(nameof(Ln.管理员充值))]
56+
[Trade(Direction = TradeDirections.Income)]
57+
AdminDeposit = 6
5158
}

src/backend/NetAdmin/NetAdmin.Infrastructure/NetAdmin.Infrastructure.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<Import Project="$(SolutionDir)/build/copy.pkg.xml.comment.files.targets"/>
44
<Import Project="$(SolutionDir)/build/prebuild.targets"/>
55
<ItemGroup>
6-
<PackageReference Include="NetAdmin.FreeSql.DbContext" Version="1.1.7" Label="refs"/>
7-
<PackageReference Include="NetAdmin.FreeSql.Provider.Sqlite" Version="1.1.7" Label="refs"/>
8-
<PackageReference Include="Gurion" Version="1.2.16" Label="refs"/>
6+
<PackageReference Include="NetAdmin.FreeSql.DbContext" Version="1.1.8" Label="refs"/>
7+
<PackageReference Include="NetAdmin.FreeSql.Provider.Sqlite" Version="1.1.8" Label="refs"/>
8+
<PackageReference Include="Gurion" Version="1.2.17" Label="refs"/>
99
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.7"/>
1010
<PackageReference Include="Minio" Version="6.0.5"/>
11-
<PackageReference Include="NSExt" Version="2.3.7"/>
12-
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.6"/>
11+
<PackageReference Include="NSExt" Version="2.3.8"/>
12+
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.7"/>
1313
</ItemGroup>
1414
<ItemGroup>
1515
<!--<ProjectReference Include="$(SolutionDir)/refs/NetAdmin.FreeSql/src/FreeSql.DbContext/FreeSql.DbContext.csproj" Label="refs"/>-->

src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/WalletTradeService.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ public async Task<int> TransferFromAnotherAccountAsync(TransferReq req)
147147
throw new NetAdminInvalidOperationException(Ln.此操作不被允许);
148148
}
149149

150+
// 不允许自己对自己转账
151+
if (UserToken.Id == fromAccount.Id) {
152+
throw new NetAdminInvalidOperationException(Ln.此操作不被允许);
153+
}
154+
150155
var fromUser = await S<IUserService>().GetAsync(new QueryUserReq { Id = fromAccount.Id }).ConfigureAwait(false);
151156

152157
// 源账户扣钱
@@ -178,6 +183,11 @@ public async Task<int> TransferToAnotherAccountAsync(TransferReq req)
178183
{
179184
var toUser = await S<IUserService>().GetAsync(new QueryUserReq { Id = req.OwnerId!.Value }).ConfigureAwait(false);
180185

186+
// 不允许自己对自己转账
187+
if (UserToken.Id == toUser.Id) {
188+
throw new NetAdminInvalidOperationException(Ln.此操作不被允许);
189+
}
190+
181191
// 自己账户扣钱
182192
_ = await CreateAsync(new CreateWalletTradeReq {
183193
Amount = -req.Amount

src/backend/NetAdmin/NetAdmin.SysComponent.Host/Controllers/Sys/UserWalletController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ public Task<IEnumerable<QueryUserWalletRsp>> QueryAsync(QueryReq<QueryUserWallet
9999
/// <summary>
100100
/// 用户钱包求和
101101
/// </summary>
102-
[NonAction]
103102
public Task<decimal> SumAsync(QueryReq<QueryUserWalletReq> req)
104103
{
105104
return Cache.SumAsync(req);

src/frontend/admin/src/api/sys/userwallet.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,15 @@ export default {
8181
return await http.post(this.url, data, config)
8282
},
8383
},
84+
85+
/**
86+
* 用户钱包求和
87+
*/
88+
sum: {
89+
url: `${config.API_URL}/api/sys/user.wallet/sum`,
90+
name: `用户钱包求和`,
91+
post: async function (data = {}, config = {}) {
92+
return await http.post(this.url, data, config)
93+
},
94+
},
8495
}

src/frontend/admin/src/components/na-table-page/detail.vue

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,39 @@
2929
:disabled="item.disabled?.includes(mode)"
3030
type="datetime"
3131
value-format="YYYY-MM-DD HH:mm:ss" />
32-
<el-select v-else-if="item.enum" v-model="form[i]" :disabled="item.disabled?.includes(mode)" clearable filterable>
33-
<el-option
34-
v-for="e in Object.entries(this.$GLOBAL.enums[item.enum]).map((x) => {
35-
return {
36-
value: x[0],
37-
text: item.enumSelectText ? item.enumSelectText(x) : item.enumText ? item.enumText(x) : x[1][1],
38-
}
39-
})"
40-
:key="e.value"
41-
:label="e.text"
42-
:value="e.value" />
43-
</el-select>
32+
<template v-else-if="item.enum">
33+
<el-radio-group v-if="item.enum.radio" v-model="form[i]" :disabled="item.disabled?.includes(mode)">
34+
<el-radio-button
35+
v-for="e in Object.entries(this.$GLOBAL.enums[item.enum.name]).map((x) => {
36+
return {
37+
value: x[0],
38+
text: item.enum.selectText
39+
? item.enum.selectText(x)
40+
: item.enum.text
41+
? item.enum.text(x)
42+
: x[1][1],
43+
}
44+
})"
45+
:label="e.text"
46+
:value="e.value" />
47+
</el-radio-group>
48+
<el-select v-else="item.enum" v-model="form[i]" :disabled="item.disabled?.includes(mode)" clearable filterable>
49+
<el-option
50+
v-for="e in Object.entries(this.$GLOBAL.enums[item.enum.name]).map((x) => {
51+
return {
52+
value: x[0],
53+
text: item.enum.selectText
54+
? item.enum.selectText(x)
55+
: item.enum.text
56+
? item.enum.text(x)
57+
: x[1][1],
58+
}
59+
})"
60+
:key="e.value"
61+
:label="e.text"
62+
:value="e.value" />
63+
</el-select>
64+
</template>
4465
<el-switch
4566
v-else-if="typeof form[i] === `boolean` || item.isSwitch"
4667
v-model="form[i]"
@@ -63,6 +84,13 @@
6384
v-model="form[i]"
6485
:disabled="item.disabled?.includes(mode)"
6586
:is="item.detail?.is ?? `el-input`" />
87+
<component
88+
v-bind="sub.props"
89+
v-for="(sub, j) in item.detail.extra"
90+
v-html="sub.html"
91+
v-if="item.detail?.extra"
92+
:is="sub.is"
93+
:key="j" />
6694
</el-form-item>
6795
</template>
6896
</el-form>

0 commit comments

Comments
 (0)