Эх сурвалжийг харах

😁账号换成子查询模式及其他优化

zuohuaijun 2 жил өмнө
parent
commit
ce3b10a0d2

+ 0 - 7
Admin.NET/Admin.NET.Core/Service/User/Dto/UserOutput.cs

@@ -25,11 +25,4 @@ public class UserOutput : SysUser
     /// 角色名称
     /// 角色名称
     /// </summary>
     /// </summary>
     public string RoleName { get; set; }
     public string RoleName { get; set; }
-
-    /// <summary>
-    /// 
-    /// </summary>
-    [Newtonsoft.Json.JsonIgnore]
-    [System.Text.Json.Serialization.JsonIgnore]
-    public int Index { get; set; }
 }
 }

+ 2 - 4
Admin.NET/Admin.NET.Core/Service/User/SysUserService.cs

@@ -68,15 +68,13 @@ public class SysUserService : IDynamicApiController, ITransient
             .WhereIF(!string.IsNullOrWhiteSpace(input.Account), u => u.Account.Contains(input.Account))
             .WhereIF(!string.IsNullOrWhiteSpace(input.Account), u => u.Account.Contains(input.Account))
             .WhereIF(!string.IsNullOrWhiteSpace(input.RealName), u => u.RealName.Contains(input.RealName))
             .WhereIF(!string.IsNullOrWhiteSpace(input.RealName), u => u.RealName.Contains(input.RealName))
             .WhereIF(!string.IsNullOrWhiteSpace(input.Phone), u => u.Phone.Contains(input.Phone))
             .WhereIF(!string.IsNullOrWhiteSpace(input.Phone), u => u.Phone.Contains(input.Phone))
+            .OrderBy(u => u.OrderNo)
             .Select((u, a, b, c, d) => new UserOutput
             .Select((u, a, b, c, d) => new UserOutput
             {
             {
-                Index = SqlFunc.RowNumber(u.Id, u.Id),
                 OrgName = a.Name,
                 OrgName = a.Name,
                 PosName = b.Name,
                 PosName = b.Name,
-                RoleName = d.Name
+                RoleName = SqlFunc.Subqueryable<SysUserRole>().LeftJoin<SysRole>((m, n) => m.RoleId == n.Id).Where(m => m.UserId == u.Id).SelectStringJoin((m, n) => n.Name, ",")
             }, true)
             }, true)
-            .MergeTable().Where(u => u.Index == 1)
-            .OrderBy(u => u.OrderNo)
             .ToPagedListAsync(input.Page, input.PageSize);
             .ToPagedListAsync(input.Page, input.PageSize);
     }
     }
 
 

+ 1 - 1
Admin.NET/Admin.NET.Core/Util/GM/GM.cs

@@ -283,7 +283,7 @@ public class GM
             X509Certificate certificate = new X509CertificateParser().ReadCertificate(fileStream);
             X509Certificate certificate = new X509CertificateParser().ReadCertificate(fileStream);
             return certificate.GetPublicKey();
             return certificate.GetPublicKey();
         }
         }
-        catch (Exception e)
+        catch (Exception)
         {
         {
             //log.Error(file.Name + "读取失败,异常:" + e);
             //log.Error(file.Name + "读取失败,异常:" + e);
         }
         }

+ 1 - 1
Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj

@@ -17,7 +17,7 @@
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\Admin.NET.Application\Admin.NET.Application.csproj" />
+    <ProjectReference Include="..\..\..\项目列表\严精监护\Code\Admin.NET\Daming.Guardian.Application\Daming.Guardian.Application.csproj" />
     <ProjectReference Include="..\Admin.NET.Core\Admin.NET.Core.csproj" />
     <ProjectReference Include="..\Admin.NET.Core\Admin.NET.Core.csproj" />
   </ItemGroup>
   </ItemGroup>
 
 

+ 2 - 2
Web/src/views/login/component/account.vue

@@ -161,9 +161,9 @@ const onSignIn = async () => {
 			// SM2加密密码
 			// SM2加密密码
 			// const keys = SM2.generateKeyPair();
 			// const keys = SM2.generateKeyPair();
 			const publicKey = `0484C7466D950E120E5ECE5DD85D0C90EAA85081A3A2BD7C57AE6DC822EFCCBD66620C67B0103FC8DD280E36C3B282977B722AAEC3C56518EDCEBAFB72C5A05312`;
 			const publicKey = `0484C7466D950E120E5ECE5DD85D0C90EAA85081A3A2BD7C57AE6DC822EFCCBD66620C67B0103FC8DD280E36C3B282977B722AAEC3C56518EDCEBAFB72C5A05312`;
-			state.ruleForm.password = sm2.doEncrypt(state.ruleForm.password, publicKey, 1);
+			const password = sm2.doEncrypt(state.ruleForm.password, publicKey, 1);
 
 
-			const [err, res] = await feature(getAPI(SysAuthApi).apiSysAuthLoginPost(state.ruleForm));
+			const [err, res] = await feature(getAPI(SysAuthApi).apiSysAuthLoginPost({ ...state.ruleForm, password: password }));
 			if (err) {
 			if (err) {
 				getCaptcha(); // 重新获取验证码
 				getCaptcha(); // 重新获取验证码
 				return;
 				return;

+ 1 - 1
Web/src/views/system/dict/index.vue

@@ -119,7 +119,7 @@
 			<el-col :span="12" :xs="24">
 			<el-col :span="12" :xs="24">
 				<el-card class="full-table" shadow="hover" :body-style="{ paddingBottom: '20' }">
 				<el-card class="full-table" shadow="hover" :body-style="{ paddingBottom: '20' }">
 					<template #header>
 					<template #header>
-						<el-icon><ele-Collection /></el-icon>{{ state.editDictTypeName }}字典值
+						<el-icon><ele-Collection /></el-icon>字典值【{{ state.editDictTypeName }}】
 					</template>
 					</template>
 					<el-form :model="state.queryDictDataParams" ref="queryForm" :inline="true">
 					<el-form :model="state.queryDictDataParams" ref="queryForm" :inline="true">
 						<!-- <el-form-item label="字典值">
 						<!-- <el-form-item label="字典值">

+ 1 - 1
Web/src/views/system/user/index.vue

@@ -61,7 +61,7 @@
 								<el-tag v-else> 其他 </el-tag>
 								<el-tag v-else> 其他 </el-tag>
 							</template>
 							</template>
 						</el-table-column>
 						</el-table-column>
-						<el-table-column prop="roleName" label="拥有角色" min-width="130" align="center" show-overflow-tooltip />
+						<el-table-column prop="roleName" label="角色集合" min-width="130" align="center" show-overflow-tooltip />
 						<el-table-column prop="orgName" label="所属机构" min-width="120" align="center" show-overflow-tooltip />
 						<el-table-column prop="orgName" label="所属机构" min-width="120" align="center" show-overflow-tooltip />
 						<el-table-column prop="posName" label="职位名称" min-width="120" align="center" show-overflow-tooltip />
 						<el-table-column prop="posName" label="职位名称" min-width="120" align="center" show-overflow-tooltip />
 						<el-table-column label="状态" width="70" align="center" show-overflow-tooltip>
 						<el-table-column label="状态" width="70" align="center" show-overflow-tooltip>