Просмотр исходного кода

😎1、增加文件上传提示 2、调整首页组件

zuohuaijun 2 лет назад
Родитель
Сommit
1b9489e86d

+ 2 - 2
Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs

@@ -315,11 +315,11 @@ public class SysFileService : IDynamicApiController, ITransient
 
         // 验证文件类型
         if (!_uploadOptions.ContentType.Contains(file.ContentType))
-            throw Oops.Oh(ErrorCodeEnum.D8001);
+            throw Oops.Oh($"{ErrorCodeEnum.D8001}:{file.ContentType}");
 
         // 验证文件大小
         if (sizeKb > _uploadOptions.MaxSize)
-            throw Oops.Oh(ErrorCodeEnum.D8002);
+            throw Oops.Oh($"{ErrorCodeEnum.D8002},允许最大:{_uploadOptions.MaxSize}KB");
 
         // 获取文件后缀
         var suffix = Path.GetExtension(file.FileName).ToLower(); // 后缀

+ 3 - 3
Web/src/views/home/widgets/components/version.vue

@@ -9,9 +9,9 @@
 			<h2 style="margin-top: 15px">Admin.NET</h2>
 			<p style="margin-top: 5px">最新版本 {{ version }}</p>
 		</div>
-		<div style="margin-top: 20px">
-			<el-button type="primary" plain round @click="golog">更新日志</el-button>
-			<el-button type="primary" plain round @click="gogit">gitee</el-button>
+		<div style="margin-top: 20px; margin-bottom: 20px; float: right">
+			<el-button type="primary" icon="ele-DocumentCopy" plain round @click="golog">更新日志</el-button>
+			<el-button type="primary" icon="ele-Eleme" plain round @click="gogit">gitee</el-button>
 		</div>
 	</el-card>
 </template>