Merge branch 'framework' of https://gitee.com/ccnetcore/Yi into framework
This commit is contained in:
@@ -16,12 +16,6 @@ export default {
|
||||
method: 'post',
|
||||
})
|
||||
},
|
||||
logged() {
|
||||
return myaxios({
|
||||
url: '/Account/logged',
|
||||
method: 'post',
|
||||
})
|
||||
},
|
||||
register(username, password, email, code) {
|
||||
return myaxios({
|
||||
url: `/Account/register?code=${code}`,
|
||||
|
||||
@@ -12,14 +12,16 @@ router.beforeEach((to, from, next) => {
|
||||
next({ path: '/login' });
|
||||
}
|
||||
} else { //如果有user还要向后端请求是否过期
|
||||
store.dispatch("Logged").then(resp => {
|
||||
if (!resp.status) //表示已经过期
|
||||
{
|
||||
store.dispatch("Logout");
|
||||
next({ path: '/login' });
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
})
|
||||
|
||||
next();
|
||||
// store.dispatch("Logged").then(resp => {
|
||||
// if (!resp.status) //表示已经过期
|
||||
// {
|
||||
// store.dispatch("Logout");
|
||||
// next({ path: '/login' });
|
||||
// } else {
|
||||
// next();
|
||||
// }
|
||||
// })
|
||||
}
|
||||
})
|
||||
@@ -63,7 +63,7 @@ const actions = { //动作
|
||||
return new Promise((resolv, reject) => {
|
||||
accountApi.login(form.username.trim(), form.password.trim()).then(resp => {
|
||||
commit('SET_TOKEN', resp.data.token)
|
||||
commit('SET_USER', resp.data.user)
|
||||
// commit('SET_USER', resp.data.user)
|
||||
resolv(resp)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
@@ -82,16 +82,6 @@ const actions = { //动作
|
||||
})
|
||||
})
|
||||
},
|
||||
Logged({ commit }) {
|
||||
return new Promise((resolv, reject) => {
|
||||
accountApi.logged().then(resp => {
|
||||
resolv(resp)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// GetUserInfo({ commit, state }) {
|
||||
// return new Promise((resolv, reject) => {
|
||||
// // getUserInfo(state.token).then(response => {
|
||||
|
||||
@@ -27,7 +27,11 @@ myaxios.interceptors.request.use(function(config) {
|
||||
|
||||
// 响应拦截器
|
||||
myaxios.interceptors.response.use(function(response) {
|
||||
// const resp = response.data
|
||||
const resp = response.data
|
||||
if(resp.code!=200)
|
||||
{
|
||||
alert(`错误代码:${resp.code},原因:${resp.message}`)
|
||||
}
|
||||
store.dispatch("closeLoad");
|
||||
return response;
|
||||
}, function(error) {
|
||||
@@ -35,7 +39,7 @@ myaxios.interceptors.response.use(function(response) {
|
||||
if (resp.code == undefined && resp.msg == undefined) {
|
||||
alert(`错误代码:无,原因:与服务器失去连接`)
|
||||
} else if (resp.code != 200) {
|
||||
alert(`错误代码:${resp.code},原因:${resp.msg}`)
|
||||
alert(`错误代码:${resp.code},原因:${resp.message}`)
|
||||
}
|
||||
store.dispatch("closeLoad");
|
||||
return Promise.reject(error);
|
||||
|
||||
@@ -95,6 +95,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
Version.cs = Version.cs
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.OperLogManager", "src\module\Yi.Framework.OperLogManager\Yi.Framework.OperLogManager.csproj", "{8A604A6B-D1FA-4CFF-BCF5-557519B10FCB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.FileManager", "src\module\Yi.Framework.FileManager\Yi.Framework.FileManager.csproj", "{1BF3115D-B027-4805-AF7B-41B3AE9CB355}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -245,6 +249,14 @@ Global
|
||||
{FC559052-36EC-4379-B447-298FAD6045F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FC559052-36EC-4379-B447-298FAD6045F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FC559052-36EC-4379-B447-298FAD6045F4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8A604A6B-D1FA-4CFF-BCF5-557519B10FCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8A604A6B-D1FA-4CFF-BCF5-557519B10FCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8A604A6B-D1FA-4CFF-BCF5-557519B10FCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8A604A6B-D1FA-4CFF-BCF5-557519B10FCB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1BF3115D-B027-4805-AF7B-41B3AE9CB355}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1BF3115D-B027-4805-AF7B-41B3AE9CB355}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1BF3115D-B027-4805-AF7B-41B3AE9CB355}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1BF3115D-B027-4805-AF7B-41B3AE9CB355}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -289,6 +301,8 @@ Global
|
||||
{0C031C7D-6F80-4559-977C-AC001036EC44} = {07C9E949-DB5E-4315-A497-FF73746667D8}
|
||||
{60E54034-792C-4A90-BCDF-4D5FFB45089E} = {EEF5F221-0E32-4A3D-B647-B4B5E7305806}
|
||||
{FC559052-36EC-4379-B447-298FAD6045F4} = {EEF5F221-0E32-4A3D-B647-B4B5E7305806}
|
||||
{8A604A6B-D1FA-4CFF-BCF5-557519B10FCB} = {EEF5F221-0E32-4A3D-B647-B4B5E7305806}
|
||||
{1BF3115D-B027-4805-AF7B-41B3AE9CB355} = {EEF5F221-0E32-4A3D-B647-B4B5E7305806}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {6C1A3808-0F4F-43FB-A9FE-5F27A3BB2ECF}
|
||||
|
||||
@@ -10,6 +10,57 @@ namespace Yi.Framework.AspNetCore.Extensions
|
||||
{
|
||||
public static class HttpContextExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 设置文件下载名称
|
||||
/// </summary>
|
||||
/// <param name="httpContext"></param>
|
||||
/// <param name="fileName"></param>
|
||||
public static void FileInlineHandle(this HttpContext httpContext, string fileName)
|
||||
{
|
||||
string encodeFilename = System.Web.HttpUtility.UrlEncode(fileName, Encoding.GetEncoding("UTF-8"));
|
||||
httpContext.Response.Headers.Add("Content-Disposition", "inline;filename=" + encodeFilename);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置文件附件名称
|
||||
/// </summary>
|
||||
/// <param name="httpContext"></param>
|
||||
/// <param name="fileName"></param>
|
||||
public static void FileAttachmentHandle(this HttpContext httpContext, string fileName)
|
||||
{
|
||||
string encodeFilename = System.Web.HttpUtility.UrlEncode(fileName, Encoding.GetEncoding("UTF-8"));
|
||||
httpContext.Response.Headers.Add("Content-Disposition", "attachment;filename=" + encodeFilename);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取语言种类
|
||||
/// </summary>
|
||||
/// <param name="httpContext"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetLanguage(this HttpContext httpContext)
|
||||
{
|
||||
string res = "zh-CN";
|
||||
var str = httpContext.Request.Headers["Accept-Language"].FirstOrDefault();
|
||||
if (str is not null)
|
||||
{
|
||||
res = str.Split(",")[0];
|
||||
}
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否为异步请求
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsAjaxRequest(this HttpRequest request)
|
||||
{
|
||||
string header = request.Headers["X-Requested-With"];
|
||||
return "XMLHttpRequest".Equals(header);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取客户端IP
|
||||
/// </summary>
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Cike.AutoApi" Version="1.0.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.13" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
|
||||
<PackageReference Include="NET.AutoApi" Version="1.0.5" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Core.Const
|
||||
{
|
||||
/// <summary>
|
||||
/// 定义公共文件常量
|
||||
/// </summary>
|
||||
public class PathConst
|
||||
{
|
||||
public const string wwwroot = "wwwroot";
|
||||
public const string DataTemplate = "_DataTemplate";
|
||||
public const string DataExport = "_DataExport";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Core.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// 定义公共文件路径
|
||||
/// </summary>
|
||||
public enum FileTypeEnum
|
||||
{
|
||||
File,
|
||||
Image,
|
||||
Thumbnail,
|
||||
Excel,
|
||||
Temp
|
||||
}
|
||||
}
|
||||
@@ -4,241 +4,257 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Core.Enums;
|
||||
|
||||
namespace Yi.Framework.Core.Helper
|
||||
{
|
||||
public static class MimeHelper
|
||||
public static class MimeHelper
|
||||
{
|
||||
// 通过自己定义一个静态类
|
||||
// 将所有的Content Type都扔进去吧
|
||||
// 调用的时候直接调用静态方法即可。
|
||||
|
||||
private static Hashtable _mimeMappingTable;
|
||||
|
||||
private static void AddMimeMapping(string extension, string MimeType)
|
||||
public static List<string> ImageType { get; set; } = new List<string>
|
||||
{
|
||||
".jpg",".png",".jpge",".gif"
|
||||
};
|
||||
|
||||
private static Hashtable _mimeMappingTable;
|
||||
|
||||
private static void AddMimeMapping(string extension, string MimeType)
|
||||
{
|
||||
MimeHelper._mimeMappingTable.Add(extension, MimeType);
|
||||
}
|
||||
|
||||
public static string GetMimeMapping(string FileName)
|
||||
{
|
||||
string text = null!;
|
||||
int num = FileName.LastIndexOf('.');
|
||||
if (0 < num && num > FileName.LastIndexOf('\\'))
|
||||
{
|
||||
MimeHelper._mimeMappingTable.Add(extension, MimeType);
|
||||
text = (string)MimeHelper._mimeMappingTable[FileName.Substring(num)]!;
|
||||
}
|
||||
|
||||
public static string GetMimeMapping(string FileName)
|
||||
if (text == null)
|
||||
{
|
||||
string text = null!;
|
||||
int num = FileName.LastIndexOf('.');
|
||||
if (0 < num && num > FileName.LastIndexOf('\\'))
|
||||
{
|
||||
text = (string)MimeHelper._mimeMappingTable[FileName.Substring(num)]!;
|
||||
}
|
||||
if (text == null)
|
||||
{
|
||||
text = (string)MimeHelper._mimeMappingTable[".*"]!;
|
||||
}
|
||||
return text;
|
||||
text = (string)MimeHelper._mimeMappingTable[".*"]!;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
public static FileTypeEnum GetFileType(string fileName)
|
||||
{
|
||||
var extension = Path.GetExtension(fileName);
|
||||
if(ImageType.Contains(extension.ToLower()))
|
||||
return FileTypeEnum.Image;
|
||||
return FileTypeEnum.File;
|
||||
|
||||
|
||||
}
|
||||
|
||||
static MimeHelper()
|
||||
{
|
||||
MimeHelper._mimeMappingTable = new Hashtable(190, StringComparer.CurrentCultureIgnoreCase);
|
||||
MimeHelper.AddMimeMapping(".323", "text/h323");
|
||||
MimeHelper.AddMimeMapping(".asx", "video/x-ms-asf");
|
||||
MimeHelper.AddMimeMapping(".acx", "application/internet-property-stream");
|
||||
MimeHelper.AddMimeMapping(".ai", "application/postscript");
|
||||
MimeHelper.AddMimeMapping(".aif", "audio/x-aiff");
|
||||
MimeHelper.AddMimeMapping(".aiff", "audio/aiff");
|
||||
MimeHelper.AddMimeMapping(".axs", "application/olescript");
|
||||
MimeHelper.AddMimeMapping(".aifc", "audio/aiff");
|
||||
MimeHelper.AddMimeMapping(".asr", "video/x-ms-asf");
|
||||
MimeHelper.AddMimeMapping(".avi", "video/x-msvideo");
|
||||
MimeHelper.AddMimeMapping(".asf", "video/x-ms-asf");
|
||||
MimeHelper.AddMimeMapping(".au", "audio/basic");
|
||||
MimeHelper.AddMimeMapping(".application", "application/x-ms-application");
|
||||
MimeHelper.AddMimeMapping(".bin", "application/octet-stream");
|
||||
MimeHelper.AddMimeMapping(".bas", "text/plain");
|
||||
MimeHelper.AddMimeMapping(".bcpio", "application/x-bcpio");
|
||||
MimeHelper.AddMimeMapping(".bmp", "image/bmp");
|
||||
MimeHelper.AddMimeMapping(".cdf", "application/x-cdf");
|
||||
MimeHelper.AddMimeMapping(".cat", "application/vndms-pkiseccat");
|
||||
MimeHelper.AddMimeMapping(".crt", "application/x-x509-ca-cert");
|
||||
MimeHelper.AddMimeMapping(".c", "text/plain");
|
||||
MimeHelper.AddMimeMapping(".css", "text/css");
|
||||
MimeHelper.AddMimeMapping(".cer", "application/x-x509-ca-cert");
|
||||
MimeHelper.AddMimeMapping(".crl", "application/pkix-crl");
|
||||
MimeHelper.AddMimeMapping(".cmx", "image/x-cmx");
|
||||
MimeHelper.AddMimeMapping(".csh", "application/x-csh");
|
||||
MimeHelper.AddMimeMapping(".cod", "image/cis-cod");
|
||||
MimeHelper.AddMimeMapping(".cpio", "application/x-cpio");
|
||||
MimeHelper.AddMimeMapping(".clp", "application/x-msclip");
|
||||
MimeHelper.AddMimeMapping(".crd", "application/x-mscardfile");
|
||||
MimeHelper.AddMimeMapping(".deploy", "application/octet-stream");
|
||||
MimeHelper.AddMimeMapping(".dll", "application/x-msdownload");
|
||||
MimeHelper.AddMimeMapping(".dot", "application/msword");
|
||||
MimeHelper.AddMimeMapping(".doc", "application/msword");
|
||||
MimeHelper.AddMimeMapping(".dvi", "application/x-dvi");
|
||||
MimeHelper.AddMimeMapping(".dir", "application/x-director");
|
||||
MimeHelper.AddMimeMapping(".dxr", "application/x-director");
|
||||
MimeHelper.AddMimeMapping(".der", "application/x-x509-ca-cert");
|
||||
MimeHelper.AddMimeMapping(".dib", "image/bmp");
|
||||
MimeHelper.AddMimeMapping(".dcr", "application/x-director");
|
||||
MimeHelper.AddMimeMapping(".disco", "text/xml");
|
||||
MimeHelper.AddMimeMapping(".exe", "application/octet-stream");
|
||||
MimeHelper.AddMimeMapping(".etx", "text/x-setext");
|
||||
MimeHelper.AddMimeMapping(".evy", "application/envoy");
|
||||
MimeHelper.AddMimeMapping(".eml", "message/rfc822");
|
||||
MimeHelper.AddMimeMapping(".eps", "application/postscript");
|
||||
MimeHelper.AddMimeMapping(".flr", "x-world/x-vrml");
|
||||
MimeHelper.AddMimeMapping(".fif", "application/fractals");
|
||||
MimeHelper.AddMimeMapping(".gtar", "application/x-gtar");
|
||||
MimeHelper.AddMimeMapping(".gif", "image/gif");
|
||||
MimeHelper.AddMimeMapping(".gz", "application/x-gzip");
|
||||
MimeHelper.AddMimeMapping(".hta", "application/hta");
|
||||
MimeHelper.AddMimeMapping(".htc", "text/x-component");
|
||||
MimeHelper.AddMimeMapping(".htt", "text/webviewhtml");
|
||||
MimeHelper.AddMimeMapping(".h", "text/plain");
|
||||
MimeHelper.AddMimeMapping(".hdf", "application/x-hdf");
|
||||
MimeHelper.AddMimeMapping(".hlp", "application/winhlp");
|
||||
MimeHelper.AddMimeMapping(".html", "text/html");
|
||||
MimeHelper.AddMimeMapping(".htm", "text/html");
|
||||
MimeHelper.AddMimeMapping(".hqx", "application/mac-binhex40");
|
||||
MimeHelper.AddMimeMapping(".isp", "application/x-internet-signup");
|
||||
MimeHelper.AddMimeMapping(".iii", "application/x-iphone");
|
||||
MimeHelper.AddMimeMapping(".ief", "image/ief");
|
||||
MimeHelper.AddMimeMapping(".ivf", "video/x-ivf");
|
||||
MimeHelper.AddMimeMapping(".ins", "application/x-internet-signup");
|
||||
MimeHelper.AddMimeMapping(".ico", "image/x-icon");
|
||||
MimeHelper.AddMimeMapping(".jpg", "image/jpeg");
|
||||
MimeHelper.AddMimeMapping(".jfif", "image/pjpeg");
|
||||
MimeHelper.AddMimeMapping(".jpe", "image/jpeg");
|
||||
MimeHelper.AddMimeMapping(".jpeg", "image/jpeg");
|
||||
MimeHelper.AddMimeMapping(".js", "application/x-javascript");
|
||||
MimeHelper.AddMimeMapping(".lsx", "video/x-la-asf");
|
||||
MimeHelper.AddMimeMapping(".latex", "application/x-latex");
|
||||
MimeHelper.AddMimeMapping(".lsf", "video/x-la-asf");
|
||||
MimeHelper.AddMimeMapping(".manifest", "application/x-ms-manifest");
|
||||
MimeHelper.AddMimeMapping(".mhtml", "message/rfc822");
|
||||
MimeHelper.AddMimeMapping(".mny", "application/x-msmoney");
|
||||
MimeHelper.AddMimeMapping(".mht", "message/rfc822");
|
||||
MimeHelper.AddMimeMapping(".mid", "audio/mid");
|
||||
MimeHelper.AddMimeMapping(".mpv2", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".man", "application/x-troff-man");
|
||||
MimeHelper.AddMimeMapping(".mvb", "application/x-msmediaview");
|
||||
MimeHelper.AddMimeMapping(".mpeg", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".m3u", "audio/x-mpegurl");
|
||||
MimeHelper.AddMimeMapping(".mdb", "application/x-msaccess");
|
||||
MimeHelper.AddMimeMapping(".mpp", "application/vnd.ms-project");
|
||||
MimeHelper.AddMimeMapping(".m1v", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".mpa", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".me", "application/x-troff-me");
|
||||
MimeHelper.AddMimeMapping(".m13", "application/x-msmediaview");
|
||||
MimeHelper.AddMimeMapping(".movie", "video/x-sgi-movie");
|
||||
MimeHelper.AddMimeMapping(".m14", "application/x-msmediaview");
|
||||
MimeHelper.AddMimeMapping(".mpe", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".mp2", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".mov", "video/quicktime");
|
||||
MimeHelper.AddMimeMapping(".mp3", "audio/mpeg");
|
||||
MimeHelper.AddMimeMapping(".mpg", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".ms", "application/x-troff-ms");
|
||||
MimeHelper.AddMimeMapping(".nc", "application/x-netcdf");
|
||||
MimeHelper.AddMimeMapping(".nws", "message/rfc822");
|
||||
MimeHelper.AddMimeMapping(".oda", "application/oda");
|
||||
MimeHelper.AddMimeMapping(".ods", "application/oleobject");
|
||||
MimeHelper.AddMimeMapping(".pmc", "application/x-perfmon");
|
||||
MimeHelper.AddMimeMapping(".p7r", "application/x-pkcs7-certreqresp");
|
||||
MimeHelper.AddMimeMapping(".p7b", "application/x-pkcs7-certificates");
|
||||
MimeHelper.AddMimeMapping(".p7s", "application/pkcs7-signature");
|
||||
MimeHelper.AddMimeMapping(".pmw", "application/x-perfmon");
|
||||
MimeHelper.AddMimeMapping(".ps", "application/postscript");
|
||||
MimeHelper.AddMimeMapping(".p7c", "application/pkcs7-mime");
|
||||
MimeHelper.AddMimeMapping(".pbm", "image/x-portable-bitmap");
|
||||
MimeHelper.AddMimeMapping(".ppm", "image/x-portable-pixmap");
|
||||
MimeHelper.AddMimeMapping(".pub", "application/x-mspublisher");
|
||||
MimeHelper.AddMimeMapping(".pnm", "image/x-portable-anymap");
|
||||
MimeHelper.AddMimeMapping(".png", "image/png");
|
||||
MimeHelper.AddMimeMapping(".pml", "application/x-perfmon");
|
||||
MimeHelper.AddMimeMapping(".p10", "application/pkcs10");
|
||||
MimeHelper.AddMimeMapping(".pfx", "application/x-pkcs12");
|
||||
MimeHelper.AddMimeMapping(".p12", "application/x-pkcs12");
|
||||
MimeHelper.AddMimeMapping(".pdf", "application/pdf");
|
||||
MimeHelper.AddMimeMapping(".pps", "application/vnd.ms-powerpoint");
|
||||
MimeHelper.AddMimeMapping(".p7m", "application/pkcs7-mime");
|
||||
MimeHelper.AddMimeMapping(".pko", "application/vndms-pkipko");
|
||||
MimeHelper.AddMimeMapping(".ppt", "application/vnd.ms-powerpoint");
|
||||
MimeHelper.AddMimeMapping(".pmr", "application/x-perfmon");
|
||||
MimeHelper.AddMimeMapping(".pma", "application/x-perfmon");
|
||||
MimeHelper.AddMimeMapping(".pot", "application/vnd.ms-powerpoint");
|
||||
MimeHelper.AddMimeMapping(".prf", "application/pics-rules");
|
||||
MimeHelper.AddMimeMapping(".pgm", "image/x-portable-graymap");
|
||||
MimeHelper.AddMimeMapping(".qt", "video/quicktime");
|
||||
MimeHelper.AddMimeMapping(".ra", "audio/x-pn-realaudio");
|
||||
MimeHelper.AddMimeMapping(".rgb", "image/x-rgb");
|
||||
MimeHelper.AddMimeMapping(".ram", "audio/x-pn-realaudio");
|
||||
MimeHelper.AddMimeMapping(".rmi", "audio/mid");
|
||||
MimeHelper.AddMimeMapping(".ras", "image/x-cmu-raster");
|
||||
MimeHelper.AddMimeMapping(".roff", "application/x-troff");
|
||||
MimeHelper.AddMimeMapping(".rtf", "application/rtf");
|
||||
MimeHelper.AddMimeMapping(".rtx", "text/richtext");
|
||||
MimeHelper.AddMimeMapping(".sv4crc", "application/x-sv4crc");
|
||||
MimeHelper.AddMimeMapping(".spc", "application/x-pkcs7-certificates");
|
||||
MimeHelper.AddMimeMapping(".setreg", "application/set-registration-initiation");
|
||||
MimeHelper.AddMimeMapping(".snd", "audio/basic");
|
||||
MimeHelper.AddMimeMapping(".stl", "application/vndms-pkistl");
|
||||
MimeHelper.AddMimeMapping(".setpay", "application/set-payment-initiation");
|
||||
MimeHelper.AddMimeMapping(".stm", "text/html");
|
||||
MimeHelper.AddMimeMapping(".shar", "application/x-shar");
|
||||
MimeHelper.AddMimeMapping(".sh", "application/x-sh");
|
||||
MimeHelper.AddMimeMapping(".sit", "application/x-stuffit");
|
||||
MimeHelper.AddMimeMapping(".spl", "application/futuresplash");
|
||||
MimeHelper.AddMimeMapping(".sct", "text/scriptlet");
|
||||
MimeHelper.AddMimeMapping(".scd", "application/x-msschedule");
|
||||
MimeHelper.AddMimeMapping(".sst", "application/vndms-pkicertstore");
|
||||
MimeHelper.AddMimeMapping(".src", "application/x-wais-source");
|
||||
MimeHelper.AddMimeMapping(".sv4cpio", "application/x-sv4cpio");
|
||||
MimeHelper.AddMimeMapping(".tex", "application/x-tex");
|
||||
MimeHelper.AddMimeMapping(".tgz", "application/x-compressed");
|
||||
MimeHelper.AddMimeMapping(".t", "application/x-troff");
|
||||
MimeHelper.AddMimeMapping(".tar", "application/x-tar");
|
||||
MimeHelper.AddMimeMapping(".tr", "application/x-troff");
|
||||
MimeHelper.AddMimeMapping(".tif", "image/tiff");
|
||||
MimeHelper.AddMimeMapping(".txt", "text/plain");
|
||||
MimeHelper.AddMimeMapping(".texinfo", "application/x-texinfo");
|
||||
MimeHelper.AddMimeMapping(".trm", "application/x-msterminal");
|
||||
MimeHelper.AddMimeMapping(".tiff", "image/tiff");
|
||||
MimeHelper.AddMimeMapping(".tcl", "application/x-tcl");
|
||||
MimeHelper.AddMimeMapping(".texi", "application/x-texinfo");
|
||||
MimeHelper.AddMimeMapping(".tsv", "text/tab-separated-values");
|
||||
MimeHelper.AddMimeMapping(".ustar", "application/x-ustar");
|
||||
MimeHelper.AddMimeMapping(".uls", "text/iuls");
|
||||
MimeHelper.AddMimeMapping(".vcf", "text/x-vcard");
|
||||
MimeHelper.AddMimeMapping(".wps", "application/vnd.ms-works");
|
||||
MimeHelper.AddMimeMapping(".wav", "audio/wav");
|
||||
MimeHelper.AddMimeMapping(".wrz", "x-world/x-vrml");
|
||||
MimeHelper.AddMimeMapping(".wri", "application/x-mswrite");
|
||||
MimeHelper.AddMimeMapping(".wks", "application/vnd.ms-works");
|
||||
MimeHelper.AddMimeMapping(".wmf", "application/x-msmetafile");
|
||||
MimeHelper.AddMimeMapping(".wcm", "application/vnd.ms-works");
|
||||
MimeHelper.AddMimeMapping(".wrl", "x-world/x-vrml");
|
||||
MimeHelper.AddMimeMapping(".wdb", "application/vnd.ms-works");
|
||||
MimeHelper.AddMimeMapping(".wsdl", "text/xml");
|
||||
MimeHelper.AddMimeMapping(".xap", "application/x-silverlight-app");
|
||||
MimeHelper.AddMimeMapping(".xml", "text/xml");
|
||||
MimeHelper.AddMimeMapping(".xlm", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xaf", "x-world/x-vrml");
|
||||
MimeHelper.AddMimeMapping(".xla", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xls", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xlsx", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xof", "x-world/x-vrml");
|
||||
MimeHelper.AddMimeMapping(".xlt", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xlc", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xsl", "text/xml");
|
||||
MimeHelper.AddMimeMapping(".xbm", "image/x-xbitmap");
|
||||
MimeHelper.AddMimeMapping(".xlw", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xpm", "image/x-xpixmap");
|
||||
MimeHelper.AddMimeMapping(".xwd", "image/x-xwindowdump");
|
||||
MimeHelper.AddMimeMapping(".xsd", "text/xml");
|
||||
MimeHelper.AddMimeMapping(".z", "application/x-compress");
|
||||
MimeHelper.AddMimeMapping(".zip", "application/x-zip-compressed");
|
||||
MimeHelper.AddMimeMapping(".*", "application/octet-stream");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static MimeHelper()
|
||||
{
|
||||
MimeHelper._mimeMappingTable = new Hashtable(190, StringComparer.CurrentCultureIgnoreCase);
|
||||
MimeHelper.AddMimeMapping(".323", "text/h323");
|
||||
MimeHelper.AddMimeMapping(".asx", "video/x-ms-asf");
|
||||
MimeHelper.AddMimeMapping(".acx", "application/internet-property-stream");
|
||||
MimeHelper.AddMimeMapping(".ai", "application/postscript");
|
||||
MimeHelper.AddMimeMapping(".aif", "audio/x-aiff");
|
||||
MimeHelper.AddMimeMapping(".aiff", "audio/aiff");
|
||||
MimeHelper.AddMimeMapping(".axs", "application/olescript");
|
||||
MimeHelper.AddMimeMapping(".aifc", "audio/aiff");
|
||||
MimeHelper.AddMimeMapping(".asr", "video/x-ms-asf");
|
||||
MimeHelper.AddMimeMapping(".avi", "video/x-msvideo");
|
||||
MimeHelper.AddMimeMapping(".asf", "video/x-ms-asf");
|
||||
MimeHelper.AddMimeMapping(".au", "audio/basic");
|
||||
MimeHelper.AddMimeMapping(".application", "application/x-ms-application");
|
||||
MimeHelper.AddMimeMapping(".bin", "application/octet-stream");
|
||||
MimeHelper.AddMimeMapping(".bas", "text/plain");
|
||||
MimeHelper.AddMimeMapping(".bcpio", "application/x-bcpio");
|
||||
MimeHelper.AddMimeMapping(".bmp", "image/bmp");
|
||||
MimeHelper.AddMimeMapping(".cdf", "application/x-cdf");
|
||||
MimeHelper.AddMimeMapping(".cat", "application/vndms-pkiseccat");
|
||||
MimeHelper.AddMimeMapping(".crt", "application/x-x509-ca-cert");
|
||||
MimeHelper.AddMimeMapping(".c", "text/plain");
|
||||
MimeHelper.AddMimeMapping(".css", "text/css");
|
||||
MimeHelper.AddMimeMapping(".cer", "application/x-x509-ca-cert");
|
||||
MimeHelper.AddMimeMapping(".crl", "application/pkix-crl");
|
||||
MimeHelper.AddMimeMapping(".cmx", "image/x-cmx");
|
||||
MimeHelper.AddMimeMapping(".csh", "application/x-csh");
|
||||
MimeHelper.AddMimeMapping(".cod", "image/cis-cod");
|
||||
MimeHelper.AddMimeMapping(".cpio", "application/x-cpio");
|
||||
MimeHelper.AddMimeMapping(".clp", "application/x-msclip");
|
||||
MimeHelper.AddMimeMapping(".crd", "application/x-mscardfile");
|
||||
MimeHelper.AddMimeMapping(".deploy", "application/octet-stream");
|
||||
MimeHelper.AddMimeMapping(".dll", "application/x-msdownload");
|
||||
MimeHelper.AddMimeMapping(".dot", "application/msword");
|
||||
MimeHelper.AddMimeMapping(".doc", "application/msword");
|
||||
MimeHelper.AddMimeMapping(".dvi", "application/x-dvi");
|
||||
MimeHelper.AddMimeMapping(".dir", "application/x-director");
|
||||
MimeHelper.AddMimeMapping(".dxr", "application/x-director");
|
||||
MimeHelper.AddMimeMapping(".der", "application/x-x509-ca-cert");
|
||||
MimeHelper.AddMimeMapping(".dib", "image/bmp");
|
||||
MimeHelper.AddMimeMapping(".dcr", "application/x-director");
|
||||
MimeHelper.AddMimeMapping(".disco", "text/xml");
|
||||
MimeHelper.AddMimeMapping(".exe", "application/octet-stream");
|
||||
MimeHelper.AddMimeMapping(".etx", "text/x-setext");
|
||||
MimeHelper.AddMimeMapping(".evy", "application/envoy");
|
||||
MimeHelper.AddMimeMapping(".eml", "message/rfc822");
|
||||
MimeHelper.AddMimeMapping(".eps", "application/postscript");
|
||||
MimeHelper.AddMimeMapping(".flr", "x-world/x-vrml");
|
||||
MimeHelper.AddMimeMapping(".fif", "application/fractals");
|
||||
MimeHelper.AddMimeMapping(".gtar", "application/x-gtar");
|
||||
MimeHelper.AddMimeMapping(".gif", "image/gif");
|
||||
MimeHelper.AddMimeMapping(".gz", "application/x-gzip");
|
||||
MimeHelper.AddMimeMapping(".hta", "application/hta");
|
||||
MimeHelper.AddMimeMapping(".htc", "text/x-component");
|
||||
MimeHelper.AddMimeMapping(".htt", "text/webviewhtml");
|
||||
MimeHelper.AddMimeMapping(".h", "text/plain");
|
||||
MimeHelper.AddMimeMapping(".hdf", "application/x-hdf");
|
||||
MimeHelper.AddMimeMapping(".hlp", "application/winhlp");
|
||||
MimeHelper.AddMimeMapping(".html", "text/html");
|
||||
MimeHelper.AddMimeMapping(".htm", "text/html");
|
||||
MimeHelper.AddMimeMapping(".hqx", "application/mac-binhex40");
|
||||
MimeHelper.AddMimeMapping(".isp", "application/x-internet-signup");
|
||||
MimeHelper.AddMimeMapping(".iii", "application/x-iphone");
|
||||
MimeHelper.AddMimeMapping(".ief", "image/ief");
|
||||
MimeHelper.AddMimeMapping(".ivf", "video/x-ivf");
|
||||
MimeHelper.AddMimeMapping(".ins", "application/x-internet-signup");
|
||||
MimeHelper.AddMimeMapping(".ico", "image/x-icon");
|
||||
MimeHelper.AddMimeMapping(".jpg", "image/jpeg");
|
||||
MimeHelper.AddMimeMapping(".jfif", "image/pjpeg");
|
||||
MimeHelper.AddMimeMapping(".jpe", "image/jpeg");
|
||||
MimeHelper.AddMimeMapping(".jpeg", "image/jpeg");
|
||||
MimeHelper.AddMimeMapping(".js", "application/x-javascript");
|
||||
MimeHelper.AddMimeMapping(".lsx", "video/x-la-asf");
|
||||
MimeHelper.AddMimeMapping(".latex", "application/x-latex");
|
||||
MimeHelper.AddMimeMapping(".lsf", "video/x-la-asf");
|
||||
MimeHelper.AddMimeMapping(".manifest", "application/x-ms-manifest");
|
||||
MimeHelper.AddMimeMapping(".mhtml", "message/rfc822");
|
||||
MimeHelper.AddMimeMapping(".mny", "application/x-msmoney");
|
||||
MimeHelper.AddMimeMapping(".mht", "message/rfc822");
|
||||
MimeHelper.AddMimeMapping(".mid", "audio/mid");
|
||||
MimeHelper.AddMimeMapping(".mpv2", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".man", "application/x-troff-man");
|
||||
MimeHelper.AddMimeMapping(".mvb", "application/x-msmediaview");
|
||||
MimeHelper.AddMimeMapping(".mpeg", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".m3u", "audio/x-mpegurl");
|
||||
MimeHelper.AddMimeMapping(".mdb", "application/x-msaccess");
|
||||
MimeHelper.AddMimeMapping(".mpp", "application/vnd.ms-project");
|
||||
MimeHelper.AddMimeMapping(".m1v", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".mpa", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".me", "application/x-troff-me");
|
||||
MimeHelper.AddMimeMapping(".m13", "application/x-msmediaview");
|
||||
MimeHelper.AddMimeMapping(".movie", "video/x-sgi-movie");
|
||||
MimeHelper.AddMimeMapping(".m14", "application/x-msmediaview");
|
||||
MimeHelper.AddMimeMapping(".mpe", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".mp2", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".mov", "video/quicktime");
|
||||
MimeHelper.AddMimeMapping(".mp3", "audio/mpeg");
|
||||
MimeHelper.AddMimeMapping(".mpg", "video/mpeg");
|
||||
MimeHelper.AddMimeMapping(".ms", "application/x-troff-ms");
|
||||
MimeHelper.AddMimeMapping(".nc", "application/x-netcdf");
|
||||
MimeHelper.AddMimeMapping(".nws", "message/rfc822");
|
||||
MimeHelper.AddMimeMapping(".oda", "application/oda");
|
||||
MimeHelper.AddMimeMapping(".ods", "application/oleobject");
|
||||
MimeHelper.AddMimeMapping(".pmc", "application/x-perfmon");
|
||||
MimeHelper.AddMimeMapping(".p7r", "application/x-pkcs7-certreqresp");
|
||||
MimeHelper.AddMimeMapping(".p7b", "application/x-pkcs7-certificates");
|
||||
MimeHelper.AddMimeMapping(".p7s", "application/pkcs7-signature");
|
||||
MimeHelper.AddMimeMapping(".pmw", "application/x-perfmon");
|
||||
MimeHelper.AddMimeMapping(".ps", "application/postscript");
|
||||
MimeHelper.AddMimeMapping(".p7c", "application/pkcs7-mime");
|
||||
MimeHelper.AddMimeMapping(".pbm", "image/x-portable-bitmap");
|
||||
MimeHelper.AddMimeMapping(".ppm", "image/x-portable-pixmap");
|
||||
MimeHelper.AddMimeMapping(".pub", "application/x-mspublisher");
|
||||
MimeHelper.AddMimeMapping(".pnm", "image/x-portable-anymap");
|
||||
MimeHelper.AddMimeMapping(".png", "image/png");
|
||||
MimeHelper.AddMimeMapping(".pml", "application/x-perfmon");
|
||||
MimeHelper.AddMimeMapping(".p10", "application/pkcs10");
|
||||
MimeHelper.AddMimeMapping(".pfx", "application/x-pkcs12");
|
||||
MimeHelper.AddMimeMapping(".p12", "application/x-pkcs12");
|
||||
MimeHelper.AddMimeMapping(".pdf", "application/pdf");
|
||||
MimeHelper.AddMimeMapping(".pps", "application/vnd.ms-powerpoint");
|
||||
MimeHelper.AddMimeMapping(".p7m", "application/pkcs7-mime");
|
||||
MimeHelper.AddMimeMapping(".pko", "application/vndms-pkipko");
|
||||
MimeHelper.AddMimeMapping(".ppt", "application/vnd.ms-powerpoint");
|
||||
MimeHelper.AddMimeMapping(".pmr", "application/x-perfmon");
|
||||
MimeHelper.AddMimeMapping(".pma", "application/x-perfmon");
|
||||
MimeHelper.AddMimeMapping(".pot", "application/vnd.ms-powerpoint");
|
||||
MimeHelper.AddMimeMapping(".prf", "application/pics-rules");
|
||||
MimeHelper.AddMimeMapping(".pgm", "image/x-portable-graymap");
|
||||
MimeHelper.AddMimeMapping(".qt", "video/quicktime");
|
||||
MimeHelper.AddMimeMapping(".ra", "audio/x-pn-realaudio");
|
||||
MimeHelper.AddMimeMapping(".rgb", "image/x-rgb");
|
||||
MimeHelper.AddMimeMapping(".ram", "audio/x-pn-realaudio");
|
||||
MimeHelper.AddMimeMapping(".rmi", "audio/mid");
|
||||
MimeHelper.AddMimeMapping(".ras", "image/x-cmu-raster");
|
||||
MimeHelper.AddMimeMapping(".roff", "application/x-troff");
|
||||
MimeHelper.AddMimeMapping(".rtf", "application/rtf");
|
||||
MimeHelper.AddMimeMapping(".rtx", "text/richtext");
|
||||
MimeHelper.AddMimeMapping(".sv4crc", "application/x-sv4crc");
|
||||
MimeHelper.AddMimeMapping(".spc", "application/x-pkcs7-certificates");
|
||||
MimeHelper.AddMimeMapping(".setreg", "application/set-registration-initiation");
|
||||
MimeHelper.AddMimeMapping(".snd", "audio/basic");
|
||||
MimeHelper.AddMimeMapping(".stl", "application/vndms-pkistl");
|
||||
MimeHelper.AddMimeMapping(".setpay", "application/set-payment-initiation");
|
||||
MimeHelper.AddMimeMapping(".stm", "text/html");
|
||||
MimeHelper.AddMimeMapping(".shar", "application/x-shar");
|
||||
MimeHelper.AddMimeMapping(".sh", "application/x-sh");
|
||||
MimeHelper.AddMimeMapping(".sit", "application/x-stuffit");
|
||||
MimeHelper.AddMimeMapping(".spl", "application/futuresplash");
|
||||
MimeHelper.AddMimeMapping(".sct", "text/scriptlet");
|
||||
MimeHelper.AddMimeMapping(".scd", "application/x-msschedule");
|
||||
MimeHelper.AddMimeMapping(".sst", "application/vndms-pkicertstore");
|
||||
MimeHelper.AddMimeMapping(".src", "application/x-wais-source");
|
||||
MimeHelper.AddMimeMapping(".sv4cpio", "application/x-sv4cpio");
|
||||
MimeHelper.AddMimeMapping(".tex", "application/x-tex");
|
||||
MimeHelper.AddMimeMapping(".tgz", "application/x-compressed");
|
||||
MimeHelper.AddMimeMapping(".t", "application/x-troff");
|
||||
MimeHelper.AddMimeMapping(".tar", "application/x-tar");
|
||||
MimeHelper.AddMimeMapping(".tr", "application/x-troff");
|
||||
MimeHelper.AddMimeMapping(".tif", "image/tiff");
|
||||
MimeHelper.AddMimeMapping(".txt", "text/plain");
|
||||
MimeHelper.AddMimeMapping(".texinfo", "application/x-texinfo");
|
||||
MimeHelper.AddMimeMapping(".trm", "application/x-msterminal");
|
||||
MimeHelper.AddMimeMapping(".tiff", "image/tiff");
|
||||
MimeHelper.AddMimeMapping(".tcl", "application/x-tcl");
|
||||
MimeHelper.AddMimeMapping(".texi", "application/x-texinfo");
|
||||
MimeHelper.AddMimeMapping(".tsv", "text/tab-separated-values");
|
||||
MimeHelper.AddMimeMapping(".ustar", "application/x-ustar");
|
||||
MimeHelper.AddMimeMapping(".uls", "text/iuls");
|
||||
MimeHelper.AddMimeMapping(".vcf", "text/x-vcard");
|
||||
MimeHelper.AddMimeMapping(".wps", "application/vnd.ms-works");
|
||||
MimeHelper.AddMimeMapping(".wav", "audio/wav");
|
||||
MimeHelper.AddMimeMapping(".wrz", "x-world/x-vrml");
|
||||
MimeHelper.AddMimeMapping(".wri", "application/x-mswrite");
|
||||
MimeHelper.AddMimeMapping(".wks", "application/vnd.ms-works");
|
||||
MimeHelper.AddMimeMapping(".wmf", "application/x-msmetafile");
|
||||
MimeHelper.AddMimeMapping(".wcm", "application/vnd.ms-works");
|
||||
MimeHelper.AddMimeMapping(".wrl", "x-world/x-vrml");
|
||||
MimeHelper.AddMimeMapping(".wdb", "application/vnd.ms-works");
|
||||
MimeHelper.AddMimeMapping(".wsdl", "text/xml");
|
||||
MimeHelper.AddMimeMapping(".xap", "application/x-silverlight-app");
|
||||
MimeHelper.AddMimeMapping(".xml", "text/xml");
|
||||
MimeHelper.AddMimeMapping(".xlm", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xaf", "x-world/x-vrml");
|
||||
MimeHelper.AddMimeMapping(".xla", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xls", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xlsx", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xof", "x-world/x-vrml");
|
||||
MimeHelper.AddMimeMapping(".xlt", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xlc", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xsl", "text/xml");
|
||||
MimeHelper.AddMimeMapping(".xbm", "image/x-xbitmap");
|
||||
MimeHelper.AddMimeMapping(".xlw", "application/vnd.ms-excel");
|
||||
MimeHelper.AddMimeMapping(".xpm", "image/x-xpixmap");
|
||||
MimeHelper.AddMimeMapping(".xwd", "image/x-xwindowdump");
|
||||
MimeHelper.AddMimeMapping(".xsd", "text/xml");
|
||||
MimeHelper.AddMimeMapping(".z", "application/x-compress");
|
||||
MimeHelper.AddMimeMapping(".zip", "application/x-zip-compressed");
|
||||
MimeHelper.AddMimeMapping(".*", "application/octet-stream");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,14 @@ namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
public class PagedAllResultRequestDto : PagedAndSortedResultRequestDto, IPagedAllResultRequestDto, IPagedAndSortedResultRequestDto, IPageTimeResultRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询开始时间条件
|
||||
/// </summary>
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询结束时间条件
|
||||
/// </summary>
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,24 @@ namespace Yi.Framework.Ddd.Dtos
|
||||
{
|
||||
public class PagedAndSortedResultRequestDto : IPagedAndSortedResultRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询当前页条件
|
||||
/// </summary>
|
||||
public int PageNum { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 查询分页大小条件
|
||||
/// </summary>
|
||||
public int PageSize { get; set; } = int.MaxValue;
|
||||
|
||||
/// <summary>
|
||||
/// 查询排序字段条件
|
||||
/// </summary>
|
||||
public string? SortBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询排序类别条件
|
||||
/// </summary>
|
||||
public OrderByEnum SortType { get; set; } = OrderByEnum.Desc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using NET.AutoWebApi.Helper;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Principal;
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace Yi.Framework.Ddd.Services
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
public async Task<bool> DeleteAsync(string id)
|
||||
public virtual async Task<bool> DeleteAsync(string id)
|
||||
{
|
||||
if (id is null)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,36 @@
|
||||
<name>Yi.Framework.Ddd</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="P:Yi.Framework.Ddd.Dtos.PagedAllResultRequestDto.StartTime">
|
||||
<summary>
|
||||
查询开始时间条件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Ddd.Dtos.PagedAllResultRequestDto.EndTime">
|
||||
<summary>
|
||||
查询结束时间条件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Ddd.Dtos.PagedAndSortedResultRequestDto.PageNum">
|
||||
<summary>
|
||||
查询当前页条件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Ddd.Dtos.PagedAndSortedResultRequestDto.PageSize">
|
||||
<summary>
|
||||
查询分页大小条件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Ddd.Dtos.PagedAndSortedResultRequestDto.SortBy">
|
||||
<summary>
|
||||
查询排序字段条件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Ddd.Dtos.PagedAndSortedResultRequestDto.SortType">
|
||||
<summary>
|
||||
查询排序类别条件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Ddd.Repositories.IRepository`1._DbQueryable">
|
||||
<summary>
|
||||
注释一下,严格意义这里应该protected,但是我认为 简易程度 与 耦合程度 中是需要进行衡量的
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Data.Auditing;
|
||||
using Yi.Framework.Ddd.Entities;
|
||||
|
||||
namespace Yi.Framework.FileManager
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件表
|
||||
///</summary>
|
||||
[SugarTable("File")]
|
||||
public class FileEntity : IEntity<long>,IAuditedObject
|
||||
{
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 文件类型
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "FileContentType")]
|
||||
public string? FileContentType { get; set; }
|
||||
/// <summary>
|
||||
/// 文件大小
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "FileSize")]
|
||||
public decimal FileSize { get; set; }
|
||||
/// <summary>
|
||||
/// 文件名
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "FileName")]
|
||||
public string FileName { get; set; }
|
||||
/// <summary>
|
||||
/// 文件路径
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "FilePath")]
|
||||
public string FilePath { get; set; }
|
||||
|
||||
public DateTime CreationTime { get; set; }
|
||||
public long? CreatorId { get; set; }
|
||||
|
||||
public long? LastModifierId { get; set; }
|
||||
|
||||
public DateTime? LastModificationTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.Framework.FileManager
|
||||
{
|
||||
public class FileGetListOutputDto:IEntityDto
|
||||
{
|
||||
public long Id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.AspNetCore.Extensions;
|
||||
using Yi.Framework.Core.Const;
|
||||
using Yi.Framework.Core.Enums;
|
||||
using Yi.Framework.Core.Helper;
|
||||
using Yi.Framework.Ddd.Repositories;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Yi.Framework.Ddd.Services.Abstract;
|
||||
using Yi.Framework.ThumbnailSharp;
|
||||
|
||||
namespace Yi.Framework.FileManager
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件处理
|
||||
/// </summary>
|
||||
public class FileService : ApplicationService, IFileService, IAutoApiService
|
||||
{
|
||||
private readonly IRepository<FileEntity> _repository;
|
||||
private readonly ThumbnailSharpManager _thumbnailSharpManager;
|
||||
private readonly HttpContext _httpContext;
|
||||
public FileService(IRepository<FileEntity> repository, ThumbnailSharpManager thumbnailSharpManager, IHttpContextAccessor httpContextAccessor
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
_thumbnailSharpManager = thumbnailSharpManager;
|
||||
if (httpContextAccessor.HttpContext is null)
|
||||
{
|
||||
throw new ApplicationException("HttpContext为空");
|
||||
}
|
||||
_httpContext = httpContextAccessor.HttpContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载文件,是否缩略图
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Route("/api/file/{code}/{isThumbnail?}")]
|
||||
public async Task<IActionResult> Get([FromRoute] long code, [FromRoute] bool? isThumbnail)
|
||||
{
|
||||
var file = await _repository.GetByIdAsync(code);
|
||||
if (file is null)
|
||||
{
|
||||
return new NotFoundResult();
|
||||
}
|
||||
|
||||
var path = file.FilePath;
|
||||
//如果为缩略图,需要修改路径
|
||||
if (isThumbnail is true)
|
||||
{
|
||||
path = $"{PathConst.wwwroot}/{FileTypeEnum.Thumbnail}/{file.Id}{Path.GetExtension(file.FileName)}";
|
||||
}
|
||||
//路径为: 文件路径/文件id+文件扩展名
|
||||
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
return new NotFoundResult();
|
||||
}
|
||||
|
||||
var steam = await File.ReadAllBytesAsync(path);
|
||||
|
||||
//设置附件下载,下载名称
|
||||
_httpContext.FileAttachmentHandle(file.FileName);
|
||||
return new FileContentResult(steam, file.FileContentType ?? @"text/plain");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<FileGetListOutputDto>> Post([FromForm] IFormFileCollection file)
|
||||
{
|
||||
if (file.Count() == 0)
|
||||
{
|
||||
throw new ArgumentException("文件上传为空!");
|
||||
}
|
||||
//批量插入
|
||||
List<FileEntity> entities = new();
|
||||
|
||||
foreach (var f in file)
|
||||
{
|
||||
FileEntity data = new();
|
||||
data.Id = SnowflakeHelper.NextId;
|
||||
data.FileSize = ((decimal)f.Length) / 1024;
|
||||
data.FileName = f.FileName;
|
||||
|
||||
|
||||
data.FileContentType = MimeHelper.GetMimeMapping(f.FileName);
|
||||
|
||||
|
||||
var type = MimeHelper.GetFileType(f.FileName);
|
||||
|
||||
//落盘文件,文件名为雪花id+自己的扩展名
|
||||
string filename = data.Id.ToString() + Path.GetExtension(f.FileName);
|
||||
string typePath = $"{PathConst.wwwroot}/{type}";
|
||||
if (!Directory.Exists(typePath))
|
||||
{
|
||||
Directory.CreateDirectory(typePath);
|
||||
}
|
||||
|
||||
var filePath = Path.Combine(typePath, filename);
|
||||
data.FilePath = filePath;
|
||||
|
||||
|
||||
//生成文件
|
||||
using (var stream = new FileStream(filePath, FileMode.CreateNew, FileAccess.ReadWrite))
|
||||
{
|
||||
await f.CopyToAsync(stream);
|
||||
|
||||
//如果是图片类型,还需要生成缩略图,当然,如果图片很小,直接复制过去即可
|
||||
if (FileTypeEnum.Image.Equals(type))
|
||||
{
|
||||
string thumbnailPath = $"{PathConst.wwwroot}/{FileTypeEnum.Thumbnail}";
|
||||
if (!Directory.Exists(thumbnailPath))
|
||||
{
|
||||
Directory.CreateDirectory(thumbnailPath);
|
||||
}
|
||||
//保存至缩略图路径
|
||||
byte[] result = null!;
|
||||
try
|
||||
{
|
||||
result = _thumbnailSharpManager.CreateThumbnailBytes(thumbnailSize: 300, imageStream: stream, imageFormat: Format.Jpeg);
|
||||
}
|
||||
catch
|
||||
{
|
||||
result = new byte[stream.Length];
|
||||
stream.Read(result, 0, result.Length);
|
||||
// 设置当前流的位置为流的开始
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
await System.IO.File.WriteAllBytesAsync(Path.Combine(thumbnailPath, filename), result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
entities.Add(data);
|
||||
}
|
||||
await _repository.InsertRangeAsync(entities);
|
||||
return entities.Adapt<List<FileGetListOutputDto>>();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.FileManager
|
||||
{
|
||||
public interface IFileService
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\framework\Yi.Framework.AspNetCore\Yi.Framework.AspNetCore.csproj" />
|
||||
<ProjectReference Include="..\..\framework\Yi.Framework.Core\Yi.Framework.Core.csproj" />
|
||||
<ProjectReference Include="..\..\framework\Yi.Framework.Data\Yi.Framework.Data.csproj" />
|
||||
<ProjectReference Include="..\..\framework\Yi.Framework.Ddd\Yi.Framework.Ddd.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.ThumbnailSharp\Yi.Framework.ThumbnailSharp.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,20 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using StartupModules;
|
||||
|
||||
namespace Yi.Framework.FileManager
|
||||
{
|
||||
public class YiFrameworkFileManagerModule : IStartupModule
|
||||
{
|
||||
public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||
{
|
||||
services.AddTransient<FileService>();
|
||||
services.AddTransient<IFileService,FileService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.AspNetCore.Extensions;
|
||||
using Yi.Framework.Core.CurrentUsers;
|
||||
using Yi.Framework.Core.Helper;
|
||||
using Yi.Framework.Ddd.Repositories;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
using Yi.RBAC.Domain.Shared.Logs;
|
||||
|
||||
namespace Yi.RBAC.Domain.Logs
|
||||
|
||||
namespace Yi.Framework.OperLogManager
|
||||
{
|
||||
public class GlobalOperLogAttribute : ActionFilterAttribute
|
||||
{
|
||||
@@ -22,11 +22,11 @@ namespace Yi.RBAC.Domain.Logs
|
||||
private IRepository<OperationLogEntity> _repository;
|
||||
private ICurrentUser _currentUser;
|
||||
//注入一个日志服务
|
||||
public GlobalOperLogAttribute(ILogger<GlobalOperLogAttribute> logger, IRepository<OperationLogEntity> repository,ICurrentUser currentUser)
|
||||
public GlobalOperLogAttribute(ILogger<GlobalOperLogAttribute> logger, IRepository<OperationLogEntity> repository, ICurrentUser currentUser)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
_currentUser=currentUser;
|
||||
_currentUser = currentUser;
|
||||
}
|
||||
|
||||
public override async void OnResultExecuted(ResultExecutedContext context)
|
||||
@@ -3,15 +3,14 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.RBAC.Application.Contracts.Logs.Dtos;
|
||||
using Yi.Framework.Ddd.Services.Abstract;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Logs
|
||||
namespace Yi.Framework.OperLogManager
|
||||
{
|
||||
/// <summary>
|
||||
/// OperationLog服务抽象
|
||||
/// </summary>
|
||||
public interface IOperationLogService : ICrudAppService<OperationLogGetListOutputDto, long, OperationLogGetListInputVo >
|
||||
public interface IOperationLogService : ICrudAppService<OperationLogGetListOutputDto, long, OperationLogGetListInputVo>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.RBAC.Domain.Shared.Logs
|
||||
namespace Yi.Framework.OperLogManager
|
||||
{
|
||||
public enum OperEnum
|
||||
{
|
||||
@@ -4,10 +4,10 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.RBAC.Domain.Shared.Logs
|
||||
namespace Yi.Framework.OperLogManager
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class OperLogAttribute : System.Attribute
|
||||
public class OperLogAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作类型
|
||||
@@ -31,8 +31,8 @@ namespace Yi.RBAC.Domain.Shared.Logs
|
||||
|
||||
public OperLogAttribute(string title, OperEnum operationType)
|
||||
{
|
||||
this.Title = title;
|
||||
this.OperType = operationType;
|
||||
Title = title;
|
||||
OperType = operationType;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,15 +5,14 @@ using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Data.Auditing;
|
||||
using Yi.Framework.Ddd.Entities;
|
||||
using Yi.RBAC.Domain.Shared.Logs;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
namespace Yi.Framework.OperLogManager
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作日志表
|
||||
///</summary>
|
||||
[SugarTable("OperationLog")]
|
||||
public class OperationLogEntity : IEntity<long>, ICreationAuditedObject
|
||||
public class OperationLogEntity : IEntity<long>, ICreationAuditedObject
|
||||
{
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
@@ -4,9 +4,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using Yi.RBAC.Domain.Shared.Logs;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Logs.Dtos
|
||||
namespace Yi.Framework.OperLogManager
|
||||
{
|
||||
public class OperationLogGetListInputVo : PagedAllResultRequestDto
|
||||
{
|
||||
@@ -4,9 +4,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using Yi.RBAC.Domain.Shared.Logs;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Logs.Dtos
|
||||
namespace Yi.Framework.OperLogManager
|
||||
{
|
||||
public class OperationLogGetListOutputDto : IEntityDto<long>
|
||||
{
|
||||
@@ -1,21 +1,17 @@
|
||||
using Yi.RBAC.Application.Contracts.Logs;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Logs.Dtos;
|
||||
using Yi.RBAC.Domain.Logs.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using SqlSugar;
|
||||
using Yi.RBAC.Application.Contracts.Logs.Dtos.LoginLog;
|
||||
using Yi.Framework.Core.Attributes;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
|
||||
namespace Yi.RBAC.Application.Logs
|
||||
namespace Yi.Framework.OperLogManager
|
||||
{
|
||||
/// <summary>
|
||||
/// OperationLog服务实现
|
||||
/// </summary>
|
||||
[AppService]
|
||||
public class OperationLogService : CrudAppService<OperationLogEntity, OperationLogGetListOutputDto, long, OperationLogGetListInputVo >,
|
||||
//[AppService]
|
||||
public class OperationLogService : CrudAppService<OperationLogEntity, OperationLogGetListOutputDto, long, OperationLogGetListInputVo>,
|
||||
IOperationLogService, IAutoApiService
|
||||
{
|
||||
public override async Task<PagedResultDto<OperationLogGetListOutputDto>> GetListAsync(OperationLogGetListInputVo input)
|
||||
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\framework\Yi.Framework.Core\Yi.Framework.Core.csproj" />
|
||||
<ProjectReference Include="..\..\framework\Yi.Framework.Data\Yi.Framework.Data.csproj" />
|
||||
<ProjectReference Include="..\..\framework\Yi.Framework.Ddd\Yi.Framework.Ddd.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,35 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using StartupModules;
|
||||
using Yi.Framework.Core;
|
||||
using Yi.Framework.Core.Attributes;
|
||||
|
||||
namespace Yi.Framework.OperLogManager
|
||||
{
|
||||
[DependsOn(typeof(YiFrameworkCoreModule))]
|
||||
public class YiFrameworkOperLogManagerModule : IStartupModule
|
||||
{
|
||||
public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context)
|
||||
{
|
||||
}
|
||||
|
||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||
{
|
||||
|
||||
services.AddControllers(options =>
|
||||
{
|
||||
options.Filters.Add<GlobalOperLogAttribute>();
|
||||
});
|
||||
//services.AddAutoApiService(opt =>
|
||||
//{
|
||||
// //NETServiceTest所在程序集添加进动态api配置
|
||||
// opt.CreateConventional(typeof(YiFrameworkOperLogManagerModule).Assembly, option => option.RootPath = string.Empty);
|
||||
|
||||
//});
|
||||
|
||||
services.AddSingleton<GlobalOperLogAttribute>();
|
||||
services.AddTransient<OperationLogService>();
|
||||
services.AddTransient<IOperationLogService, OperationLogService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,9 +20,9 @@ TemplateFactory templateFactory = new();
|
||||
//string modelName = "Dictionary";
|
||||
//string nameSpaces = "Yi.RBAC";
|
||||
//List<string> entityNames = new() { "_", "_" };
|
||||
string modelName = "Logs";
|
||||
string modelName = "Setting";
|
||||
string nameSpaces = "Yi.RBAC";
|
||||
List<string> entityNames = new() { "_" };
|
||||
List<string> entityNames = new() { "File" };
|
||||
|
||||
|
||||
foreach (var entityName in entityNames)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using #NameSpaces#.Application.Contracts.#ModelName#;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using #NameSpaces#.Application.Contracts.#ModelName#.Dtos;
|
||||
using #NameSpaces#.Domain.#ModelName#.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -120,25 +120,6 @@
|
||||
临时服务,之后用其他模块代替
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.PostLoginAsync">
|
||||
<summary>
|
||||
登录
|
||||
</summary>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.NotImplementedException"></exception>
|
||||
</member>
|
||||
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.PostLogged">
|
||||
<summary>
|
||||
判断是否有登录
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.PostlogOut">
|
||||
<summary>
|
||||
退出登录
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.GetUserInfoByIdAsync(System.Int64)">
|
||||
<summary>
|
||||
获取用户信息
|
||||
|
||||
@@ -10,6 +10,7 @@ using Yi.Framework.Core.Autofac;
|
||||
using Yi.RBAC.Application;
|
||||
using Yi.Framework.AspNetCore;
|
||||
using Yi.Framework.Data.Json;
|
||||
using Yi.Framework.OperLogManager;
|
||||
|
||||
namespace Yi.BBS.Web
|
||||
{
|
||||
@@ -31,7 +32,6 @@ namespace Yi.BBS.Web
|
||||
{
|
||||
//NETServiceTest所在程序集添加进动态api配置
|
||||
opt.CreateConventional(typeof(YiBBSApplicationModule).Assembly, option => option.RootPath = string.Empty);
|
||||
//opt.CreateConventional(typeof(YiRBACApplicationModule).Assembly, option => option.RootPath = string.Empty);
|
||||
});
|
||||
|
||||
//添加swagger
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"DbConnOptions": {
|
||||
"Url": "DataSource=yi-sqlsugar-dev.db",
|
||||
"DbType": "Sqlite",
|
||||
"EnabledDbSeed": false,
|
||||
"EnabledDbSeed": true,
|
||||
"EnabledReadWrite": false,
|
||||
"EnabledCodeFirst": true,
|
||||
"EntityAssembly": null,
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
using Yi.Template.Application.Contracts.School;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.Template.Application.Contracts.School.Dtos;
|
||||
using Yi.Template.Domain.School.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -120,25 +120,6 @@
|
||||
临时服务,之后用其他模块代替
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.PostLoginAsync">
|
||||
<summary>
|
||||
登录
|
||||
</summary>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.NotImplementedException"></exception>
|
||||
</member>
|
||||
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.PostLogged">
|
||||
<summary>
|
||||
判断是否有登录
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.PostlogOut">
|
||||
<summary>
|
||||
退出登录
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.BBS.Application.GlobalSetting.TempService.GetUserInfoByIdAsync(System.Int64)">
|
||||
<summary>
|
||||
获取用户信息
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.BBS.Application.Contracts.Exhibition;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.BBS.Application.Contracts.Exhibition.Dtos;
|
||||
using Yi.BBS.Domain.Exhibition.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.BBS.Application.Contracts.Forum;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||
using Yi.BBS.Domain.Forum.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.BBS.Application.Contracts.Forum;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||
using Yi.BBS.Domain.Forum.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.BBS.Application.Contracts.Forum;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||
using Yi.BBS.Domain.Forum.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.BBS.Application.Contracts.Forum;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||
using Yi.BBS.Domain.Forum.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.BBS.Application.Contracts.Forum;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
||||
using Yi.BBS.Domain.Forum.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.BBS.Application.Contracts.GlobalSetting;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.BBS.Domain.GlobalSetting.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.BBS.Application.Contracts.GlobalSetting;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.BBS.Domain.GlobalSetting.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -14,43 +14,43 @@ namespace Yi.BBS.Application.GlobalSetting
|
||||
[AppService]
|
||||
public class TempService : ApplicationService, IAutoApiService
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
[Route("/api/account/login")]
|
||||
public Task<LoginDto> PostLoginAsync()
|
||||
{
|
||||
bool loginSucces = true;
|
||||
if (!loginSucces)
|
||||
{
|
||||
throw new UserFriendlyException("登录失败", (int)BbsHttpStatusEnum.LoginFailed, "用户或者密码错误");
|
||||
}
|
||||
var dto = new LoginDto("token");
|
||||
dto.User = new LoginUserInfoDto { Icon = "", Id = 0, Level = 1, UserName = "橙子" };
|
||||
return Task.FromResult(dto);
|
||||
}
|
||||
///// <summary>
|
||||
///// 登录
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
///// <exception cref="NotImplementedException"></exception>
|
||||
//[Route("/api/account/login")]
|
||||
//public Task<LoginDto> PostLoginAsync()
|
||||
//{
|
||||
// bool loginSucces = true;
|
||||
// if (!loginSucces)
|
||||
// {
|
||||
// throw new UserFriendlyException("登录失败", (int)BbsHttpStatusEnum.LoginFailed, "用户或者密码错误");
|
||||
// }
|
||||
// var dto = new LoginDto("token");
|
||||
// dto.User = new LoginUserInfoDto { Icon = "", Id = 0, Level = 1, UserName = "橙子" };
|
||||
// return Task.FromResult(dto);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否有登录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Route("/api/account/logged")]
|
||||
public Task<bool> PostLogged()
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
///// <summary>
|
||||
///// 判断是否有登录
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[Route("/api/account/logged")]
|
||||
//public Task<bool> PostLogged()
|
||||
//{
|
||||
// return Task.FromResult(true);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 退出登录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Route("/api/account/logout")]
|
||||
public Task PostlogOut()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
///// <summary>
|
||||
///// 退出登录
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[Route("/api/account/logout")]
|
||||
//public Task PostlogOut()
|
||||
//{
|
||||
// return Task.CompletedTask;
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户信息
|
||||
|
||||
@@ -10,6 +10,7 @@ using Yi.Framework.Core.Autofac;
|
||||
using Yi.RBAC.Application;
|
||||
using Yi.Framework.AspNetCore;
|
||||
using Yi.Framework.Data.Json;
|
||||
using Yi.Framework.OperLogManager;
|
||||
|
||||
namespace Yi.BBS.Web
|
||||
{
|
||||
@@ -31,7 +32,6 @@ namespace Yi.BBS.Web
|
||||
{
|
||||
//NETServiceTest所在程序集添加进动态api配置
|
||||
opt.CreateConventional(typeof(YiBBSApplicationModule).Assembly, option => option.RootPath = string.Empty);
|
||||
//opt.CreateConventional(typeof(YiRBACApplicationModule).Assembly, option => option.RootPath = string.Empty);
|
||||
});
|
||||
|
||||
//添加swagger
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"DbConnOptions": {
|
||||
"Url": "DataSource=yi-sqlsugar-dev.db",
|
||||
"DbType": "Sqlite",
|
||||
"EnabledDbSeed": false,
|
||||
"EnabledDbSeed": true,
|
||||
"EnabledReadWrite": false,
|
||||
"EnabledCodeFirst": true,
|
||||
"EntityAssembly": null,
|
||||
|
||||
Binary file not shown.
@@ -94,16 +94,61 @@
|
||||
登录信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Contracts.Logs.IOperationLogService">
|
||||
<summary>
|
||||
OperationLog服务抽象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigCreateInputVo">
|
||||
<summary>
|
||||
Config输入创建对象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListInputVo">
|
||||
<summary>
|
||||
配置查询参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListInputVo.ConfigName">
|
||||
<summary>
|
||||
配置名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListInputVo.ConfigKey">
|
||||
<summary>
|
||||
配置键
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListOutputDto.ConfigName">
|
||||
<summary>
|
||||
配置名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListOutputDto.ConfigKey">
|
||||
<summary>
|
||||
配置主键
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListOutputDto.ConfigValue">
|
||||
<summary>
|
||||
配置值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListOutputDto.ConfigType">
|
||||
<summary>
|
||||
配置类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListOutputDto.OrderNum">
|
||||
<summary>
|
||||
排序字段
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListOutputDto.Remark">
|
||||
<summary>
|
||||
备注
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListOutputDto.CreationTime">
|
||||
<summary>
|
||||
创建时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Contracts.Setting.IConfigService">
|
||||
<summary>
|
||||
Config服务抽象
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Identity.Dtos.Account
|
||||
{
|
||||
public class UpdateIconDto
|
||||
{
|
||||
public string? Icon { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Mapster;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.RBAC.Domain.Shared.Identity.EnumClasses;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Identity.Dtos.User
|
||||
{
|
||||
public class ProfileUpdateInputVo
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public int? Age { get; set; }
|
||||
public string? Nick { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public long? Phone { get; set; }
|
||||
public string? Introduction { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public SexEnum? Sex { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,20 @@ using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Setting.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>ò<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public class ConfigGetListInputVo : PagedAllResultRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public string? ConfigName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD>ü<EFBFBD>
|
||||
/// </summary>
|
||||
public string? ConfigKey { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,12 +10,36 @@ namespace Yi.RBAC.Application.Contracts.Setting.Dtos
|
||||
public class ConfigGetListOutputDto : IEntityDto<long>
|
||||
{
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public string ConfigName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public string ConfigKey { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>ֵ
|
||||
/// </summary>
|
||||
public string ConfigValue { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public string? ConfigType { get; set; }
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
|
||||
/// </summary>
|
||||
public int OrderNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <20><>ע
|
||||
/// </summary>
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
/// </summary>
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,13 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.RBAC.Application.Identity.AccountService.UpdateIconAsync(Yi.RBAC.Application.Contracts.Identity.Dtos.Account.UpdateIconDto)">
|
||||
<summary>
|
||||
更新头像
|
||||
</summary>
|
||||
<param name="icon"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Identity.DeptService">
|
||||
<summary>
|
||||
Dept服务实现
|
||||
@@ -171,6 +178,13 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.RBAC.Application.Identity.UserService.UpdateProfileAsync(Yi.RBAC.Application.Contracts.Identity.Dtos.User.ProfileUpdateInputVo)">
|
||||
<summary>
|
||||
更新个人中心
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.RBAC.Application.Identity.UserService.UpdateStateAsync(System.Int64,System.Boolean)">
|
||||
<summary>
|
||||
更新状态
|
||||
@@ -179,15 +193,17 @@
|
||||
<param name="state"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Logs.OperationLogService">
|
||||
<summary>
|
||||
OperationLog服务实现
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Setting.ConfigService">
|
||||
<summary>
|
||||
Config服务实现
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Yi.RBAC.Application.Setting.ConfigService.GetListAsync(Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListInputVo)">
|
||||
<summary>
|
||||
多查
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.RBAC.Application.Contracts.Dictionary;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
|
||||
using Yi.RBAC.Domain.Dictionary.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.RBAC.Application.Contracts.Dictionary;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
|
||||
using Yi.RBAC.Domain.Dictionary.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -28,6 +28,7 @@ using Yi.RBAC.Domain.Identity.Repositories;
|
||||
using Yi.RBAC.Domain.Shared.Identity.ConstClasses;
|
||||
using Yi.RBAC.Domain.Shared.Identity.Dtos;
|
||||
using Yi.RBAC.Domain.Shared.Identity.Etos;
|
||||
using System.Net.WebSockets;
|
||||
|
||||
namespace Yi.RBAC.Application.Identity
|
||||
{
|
||||
@@ -188,5 +189,19 @@ namespace Yi.RBAC.Application.Identity
|
||||
await _accountManager.RestPasswordAsync(userId, input.Password);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新头像
|
||||
/// </summary>
|
||||
/// <param name="icon"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> UpdateIconAsync(UpdateIconDto input)
|
||||
{
|
||||
var entity = await _userRepository.GetByIdAsync(_currentUser.Id);
|
||||
entity.Icon = input.Icon;
|
||||
await _userRepository.UpdateAsync(entity);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using Yi.RBAC.Application.Contracts.Identity;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
||||
using Yi.RBAC.Domain.Identity.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using SqlSugar;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
|
||||
namespace Yi.RBAC.Application.Identity
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.RBAC.Application.Contracts.Identity;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
||||
using Yi.RBAC.Domain.Identity.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.RBAC.Application.Contracts.Identity;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
||||
using Yi.RBAC.Domain.Identity.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.RBAC.Application.Contracts.Identity;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
||||
using Yi.RBAC.Domain.Identity.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.RBAC.Application.Contracts.Identity;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
||||
using Yi.RBAC.Domain.Identity.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
@@ -12,7 +12,9 @@ using SqlSugar;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Yi.Framework.Auth.JwtBearer.Authorization;
|
||||
using Yi.RBAC.Domain.Shared.Logs;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos.User;
|
||||
using Yi.Framework.Core.CurrentUsers;
|
||||
using Yi.Framework.OperLogManager;
|
||||
|
||||
namespace Yi.RBAC.Application.Identity
|
||||
{
|
||||
@@ -32,6 +34,9 @@ namespace Yi.RBAC.Application.Identity
|
||||
[Autowired]
|
||||
private IUserRepository _userRepository { get; set; }
|
||||
|
||||
[Autowired]
|
||||
private ICurrentUser _currentUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询用户
|
||||
/// </summary>
|
||||
@@ -138,6 +143,21 @@ namespace Yi.RBAC.Application.Identity
|
||||
return await MapToGetOutputDtoAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新个人中心
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[OperLog("更新个人信息", OperEnum.Update)]
|
||||
public async Task<UserGetOutputDto> UpdateProfileAsync(ProfileUpdateInputVo input)
|
||||
{
|
||||
var entity = await _repository.GetByIdAsync(_currentUser.Id);
|
||||
_mapper.Map(input, entity);
|
||||
await _repository.UpdateAsync(entity);
|
||||
var dto = _mapper.Map<UserGetOutputDto>(entity);
|
||||
return dto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新状态
|
||||
/// </summary>
|
||||
@@ -158,5 +178,10 @@ namespace Yi.RBAC.Application.Identity
|
||||
await _repository.UpdateAsync(entity);
|
||||
return await MapToGetOutputDtoAsync(entity);
|
||||
}
|
||||
[OperLog("删除用户", OperEnum.Delete)]
|
||||
public override Task<bool> DeleteAsync(string id)
|
||||
{
|
||||
return base.DeleteAsync(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Yi.RBAC.Application.Contracts.Setting;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Setting.Dtos;
|
||||
using Yi.RBAC.Domain.Setting.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
@@ -19,6 +19,11 @@ namespace Yi.RBAC.Application.Setting
|
||||
public class ConfigService : CrudAppService<ConfigEntity, ConfigGetOutputDto, ConfigGetListOutputDto, long, ConfigGetListInputVo, ConfigCreateInputVo, ConfigUpdateInputVo>,
|
||||
IConfigService, IAutoApiService
|
||||
{
|
||||
/// <summary>
|
||||
/// 多查
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<PagedResultDto<ConfigGetListOutputDto>> GetListAsync(ConfigGetListInputVo input)
|
||||
{
|
||||
var entity = await MapToEntityAsync(input);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Data.DataSeeds;
|
||||
using Yi.Framework.Ddd.Repositories;
|
||||
using Yi.RBAC.Domain.Identity.Entities;
|
||||
using Yi.RBAC.Domain.Shared.Identity.EnumClasses;
|
||||
|
||||
namespace Yi.RBAC.Domain.DataSeeds
|
||||
{
|
||||
[AppService(typeof(IDataSeed))]
|
||||
public class UserDataSeed : AbstractDataSeed<UserEntity>
|
||||
{
|
||||
public UserDataSeed(IRepository<UserEntity> repository) : base(repository)
|
||||
{
|
||||
}
|
||||
|
||||
public override List<UserEntity> GetSeedData()
|
||||
{
|
||||
var entities=new List<UserEntity>();
|
||||
UserEntity user1 = new UserEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
Name = "大橙子",
|
||||
UserName = "cc",
|
||||
Nick = "橙子",
|
||||
Password = "123456",
|
||||
Email = "454313500@qq.com",
|
||||
Phone = 13800000000,
|
||||
Sex = SexEnum.Male,
|
||||
Address = "深圳",
|
||||
Age = 20,
|
||||
Introduction = "还有谁?",
|
||||
OrderNum = 999,
|
||||
Remark = "描述是什么呢?",
|
||||
State = true
|
||||
};
|
||||
user1.BuildPassword();
|
||||
entities.Add(user1);
|
||||
|
||||
UserEntity user2 = new UserEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
Name = "大测试",
|
||||
UserName = "test",
|
||||
Nick = "测试",
|
||||
Password = "123456",
|
||||
Email = "454313500@qq.com",
|
||||
Phone = 15900000000,
|
||||
Sex = SexEnum.Woman,
|
||||
Address = "深圳",
|
||||
Age = 18,
|
||||
Introduction = "还有我!",
|
||||
OrderNum = 1,
|
||||
Remark = "我没有描述!",
|
||||
State = true
|
||||
|
||||
};
|
||||
user2.BuildPassword();
|
||||
entities.Add(user2);
|
||||
|
||||
return entities;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -790,55 +790,5 @@
|
||||
描述
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Yi.Framework.Model.RABC.Entitys.OperationLogEntity">
|
||||
<summary>
|
||||
操作日志表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Model.RABC.Entitys.OperationLogEntity.Title">
|
||||
<summary>
|
||||
操作模块
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Model.RABC.Entitys.OperationLogEntity.OperType">
|
||||
<summary>
|
||||
操作类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Model.RABC.Entitys.OperationLogEntity.RequestMethod">
|
||||
<summary>
|
||||
请求方法
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Model.RABC.Entitys.OperationLogEntity.OperUser">
|
||||
<summary>
|
||||
操作人员
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Model.RABC.Entitys.OperationLogEntity.OperIp">
|
||||
<summary>
|
||||
操作Ip
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Model.RABC.Entitys.OperationLogEntity.OperLocation">
|
||||
<summary>
|
||||
操作地点
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Model.RABC.Entitys.OperationLogEntity.Method">
|
||||
<summary>
|
||||
操作方法
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Model.RABC.Entitys.OperationLogEntity.RequestParam">
|
||||
<summary>
|
||||
请求参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.Framework.Model.RABC.Entitys.OperationLogEntity.RequestResult">
|
||||
<summary>
|
||||
请求结果
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Hei.Captcha" Version="0.3.0" />
|
||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\framework\Yi.Framework.Data\Yi.Framework.Data.csproj" />
|
||||
<ProjectReference Include="..\..\..\module\Yi.Framework.EventBus\Yi.Framework.EventBus.csproj" />
|
||||
<ProjectReference Include="..\..\..\module\Yi.Framework.FileManager\Yi.Framework.FileManager.csproj" />
|
||||
<ProjectReference Include="..\..\..\module\Yi.Framework.OperLogManager\Yi.Framework.OperLogManager.csproj" />
|
||||
<ProjectReference Include="..\..\..\module\Yi.Framework.ThumbnailSharp\Yi.Framework.ThumbnailSharp.csproj" />
|
||||
<ProjectReference Include="..\Yi.RBAC.Domain.Shared\Yi.RBAC.Domain.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -10,6 +10,8 @@ using System.Threading.Tasks;
|
||||
using Yi.Framework.Core.Attributes;
|
||||
using Yi.Framework.Data;
|
||||
using Yi.Framework.EventBus;
|
||||
using Yi.Framework.FileManager;
|
||||
using Yi.Framework.OperLogManager;
|
||||
using Yi.Framework.ThumbnailSharp;
|
||||
using Yi.RBAC.Domain.Logs;
|
||||
using Yi.RBAC.Domain.Shared;
|
||||
@@ -20,7 +22,9 @@ namespace Yi.RBAC.Domain
|
||||
typeof(YiRBACDomainSharedModule),
|
||||
typeof(YiFrameworkDataModule),
|
||||
typeof(YiFrameworkThumbnailSharpModule),
|
||||
typeof(YiFrameworkEventBusModule)
|
||||
typeof(YiFrameworkEventBusModule),
|
||||
typeof(YiFrameworkOperLogManagerModule),
|
||||
typeof(YiFrameworkFileManagerModule)
|
||||
)]
|
||||
public class YiRBACDomainModule : IStartupModule
|
||||
{
|
||||
@@ -31,10 +35,7 @@ namespace Yi.RBAC.Domain
|
||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||
{
|
||||
services.AddHeiCaptcha();
|
||||
services.AddControllers(options => {
|
||||
options.Filters.Add<GlobalOperLogAttribute>();
|
||||
});
|
||||
services.AddSingleton<GlobalOperLogAttribute>();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using Yi.Framework.Core;
|
||||
using Yi.Framework.Core.Attributes;
|
||||
using Yi.Framework.Core.Autofac;
|
||||
using Yi.Framework.Data.Json;
|
||||
using Yi.Framework.OperLogManager;
|
||||
using Yi.RBAC.Application;
|
||||
using Yi.RBAC.Sqlsugar;
|
||||
|
||||
@@ -28,12 +29,16 @@ namespace Yi.RBAC.Web
|
||||
opt.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
services.AddAutoApiService(opt =>
|
||||
{
|
||||
//NETServiceTest所在程序集添加进动态api配置
|
||||
opt.CreateConventional(typeof(YiRBACApplicationModule).Assembly, option => option.RootPath = string.Empty);
|
||||
opt.CreateConventional(AssemblyHelper.GetAllLoadAssembly(), option => option.RootPath = string.Empty);
|
||||
|
||||
});
|
||||
|
||||
|
||||
//添加swagger
|
||||
services.AddSwaggerServer<YiRBACApplicationModule>();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
3-5
|
||||
一周一次
|
||||
|
||||
实现涂膜功能
|
||||
1:数据存储,Crud
|
||||
2:后台线程,任务调度
|
||||
3:plc通信交互,IM工厂
|
||||
4:定时任务界面管控
|
||||
5:signlr开发
|
||||
6:授权鉴权
|
||||
7:用户角色菜单模块
|
||||
8:配置文件统一标准化
|
||||
9:规范问题
|
||||
10:动态api
|
||||
11:发布订阅
|
||||
12:resful
|
||||
13:dto注释
|
||||
14:代码中文
|
||||
15:种子数据
|
||||
|
||||
1:job任务调度的模式,可以在if上的改
|
||||
2:Crud,EntityServiceBase,考虑复用的话sqlsugar这块就不用动了、仓储、工作单元、过滤器
|
||||
3:IOptionsWritable ,直接可以复用
|
||||
4:事件,是否需要,需要的话,用哪个
|
||||
5:动态api,是否需要
|
||||
6:IM,IVarReader中的IDataChannel工厂
|
||||
6:ISignal
|
||||
7:微软日志扩展,这块是否考虑封装出来,还是直接提供微软日志的扩展,我们提供模板就可以了
|
||||
@@ -0,0 +1,28 @@
|
||||
3-5
|
||||
一周一次
|
||||
|
||||
实现涂膜功能
|
||||
1:数据存储,Crud
|
||||
2:后台线程,任务调度
|
||||
3:plc通信交互,IM工厂
|
||||
4:定时任务界面管控
|
||||
5:signlr开发
|
||||
6:授权鉴权
|
||||
7:用户角色菜单模块
|
||||
8:配置文件统一标准化
|
||||
9:规范问题
|
||||
10:动态api
|
||||
11:发布订阅
|
||||
12:resful
|
||||
13:dto注释
|
||||
14:代码中文
|
||||
15:种子数据
|
||||
|
||||
1:job任务调度的模式,可以在if上的改
|
||||
2:Crud,EntityServiceBase,考虑复用的话sqlsugar这块就不用动了、仓储、工作单元、过滤器
|
||||
3:IOptionsWritable ,直接可以复用
|
||||
4:事件,是否需要,需要的话,用哪个
|
||||
5:动态api,是否需要
|
||||
6:IM,IVarReader中的IDataChannel工厂
|
||||
6:ISignal
|
||||
7:微软日志扩展,这块是否考虑封装出来,还是直接提供微软日志的扩展,我们提供模板就可以了
|
||||
@@ -0,0 +1,28 @@
|
||||
3-5
|
||||
一周一次
|
||||
|
||||
实现涂膜功能
|
||||
1:数据存储,Crud
|
||||
2:后台线程,任务调度
|
||||
3:plc通信交互,IM工厂
|
||||
4:定时任务界面管控
|
||||
5:signlr开发
|
||||
6:授权鉴权
|
||||
7:用户角色菜单模块
|
||||
8:配置文件统一标准化
|
||||
9:规范问题
|
||||
10:动态api
|
||||
11:发布订阅
|
||||
12:resful
|
||||
13:dto注释
|
||||
14:代码中文
|
||||
15:种子数据
|
||||
|
||||
1:job任务调度的模式,可以在if上的改
|
||||
2:Crud,EntityServiceBase,考虑复用的话sqlsugar这块就不用动了、仓储、工作单元、过滤器
|
||||
3:IOptionsWritable ,直接可以复用
|
||||
4:事件,是否需要,需要的话,用哪个
|
||||
5:动态api,是否需要
|
||||
6:IM,IVarReader中的IDataChannel工厂
|
||||
6:ISignal
|
||||
7:微软日志扩展,这块是否考虑封装出来,还是直接提供微软日志的扩展,我们提供模板就可以了
|
||||
@@ -0,0 +1,28 @@
|
||||
3-5
|
||||
一周一次
|
||||
|
||||
实现涂膜功能
|
||||
1:数据存储,Crud
|
||||
2:后台线程,任务调度
|
||||
3:plc通信交互,IM工厂
|
||||
4:定时任务界面管控
|
||||
5:signlr开发
|
||||
6:授权鉴权
|
||||
7:用户角色菜单模块
|
||||
8:配置文件统一标准化
|
||||
9:规范问题
|
||||
10:动态api
|
||||
11:发布订阅
|
||||
12:resful
|
||||
13:dto注释
|
||||
14:代码中文
|
||||
15:种子数据
|
||||
|
||||
1:job任务调度的模式,可以在if上的改
|
||||
2:Crud,EntityServiceBase,考虑复用的话sqlsugar这块就不用动了、仓储、工作单元、过滤器
|
||||
3:IOptionsWritable ,直接可以复用
|
||||
4:事件,是否需要,需要的话,用哪个
|
||||
5:动态api,是否需要
|
||||
6:IM,IVarReader中的IDataChannel工厂
|
||||
6:ISignal
|
||||
7:微软日志扩展,这块是否考虑封装出来,还是直接提供微软日志的扩展,我们提供模板就可以了
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
using Yi.Template.Application.Contracts.School;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Cike.AutoWebApi.Setting;
|
||||
using Yi.Template.Application.Contracts.School.Dtos;
|
||||
using Yi.Template.Domain.School.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function
|
||||
upload(type,data){
|
||||
upload(data){
|
||||
return request({
|
||||
url: `/file/upload/${type}`,
|
||||
url: `/file`,
|
||||
headers:{"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"},
|
||||
method: 'POST',
|
||||
data:data
|
||||
|
||||
@@ -69,7 +69,7 @@ export function changeUserStatus(userId, isDel) {
|
||||
// 查询用户个人信息
|
||||
export function getUserProfile() {
|
||||
return request({
|
||||
url: '/account/getUserAllInfo',
|
||||
url: '/account',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -77,11 +77,20 @@ export function getUserProfile() {
|
||||
// 修改用户个人信息
|
||||
export function updateUserProfile(data) {
|
||||
return request({
|
||||
url: '/user/UpdateProfile',
|
||||
url: `/user/profile`,
|
||||
method: 'put',
|
||||
data: { user: data }
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 只修改用户头像
|
||||
export function updateUserIcon(data) {
|
||||
return request({
|
||||
url: `/account/icon`,
|
||||
method: 'put',
|
||||
data:{icon:data}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 用户密码重置
|
||||
export function updateUserPwd(oldPassword, newPassword) {
|
||||
|
||||
@@ -74,14 +74,11 @@ service.interceptors.request.use(config => {
|
||||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(res => {
|
||||
// // 未设置状态码则默认成功状态
|
||||
// const code = res.data.code || 200;
|
||||
// // 获取错误信息
|
||||
// const msg = errorCode[code] || res.data.message || errorCode['default']
|
||||
|
||||
const code=200;
|
||||
const msg="成功";
|
||||
|
||||
// 未设置状态码则默认成功状态
|
||||
const code = res.data.code || 200;
|
||||
// 获取错误信息
|
||||
const msg = errorCode[code] || res.data.message || errorCode['default']
|
||||
|
||||
// 二进制数据则直接返回
|
||||
if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){
|
||||
return res
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="isDeleted">
|
||||
<el-select v-model="queryParams.isDeleted" placeholder="日志状态" clearable style="width: 240px">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-select v-model="queryParams.state" placeholder="日志状态" clearable style="width: 240px">
|
||||
<el-option v-for="dict in sys_common_status" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
@@ -100,9 +100,9 @@
|
||||
<el-table-column label="请求方式" align="center" prop="requestMethod" />
|
||||
<el-table-column label="操作人员" align="center" prop="operUser" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" width="100" />
|
||||
<el-table-column label="主机" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作状态" align="center" prop="isDeleted">
|
||||
<el-table-column label="操作状态" align="center" prop="state">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_common_status" :value="scope.row.isDeleted" />
|
||||
<dict-tag :options="sys_common_status" :value="scope.row.state" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作日期" align="center" prop="createTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
|
||||
@@ -163,7 +163,7 @@
|
||||
<el-form-item label="操作时间:">{{ parseTime(form.createTime) }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="异常信息:" v-if="form.isDeleted === 1">{{ form.errorMsg }}</el-form-item>
|
||||
<el-form-item label="异常信息:" v-if="form.state === 1">{{ form.errorMsg }}</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@@ -202,7 +202,7 @@ const data = reactive({
|
||||
title: undefined,
|
||||
operUser: undefined,
|
||||
operType: undefined,
|
||||
isDeleted: undefined
|
||||
state: undefined
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
import "vue-cropper/dist/index.css";
|
||||
import { VueCropper } from "vue-cropper";
|
||||
import { upload } from "@/api/file";
|
||||
import { updateUserProfile } from "@/api/system/user";
|
||||
import { updateUserIcon } from "@/api/system/user";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -116,14 +116,11 @@ function uploadImg() {
|
||||
proxy.$refs.cropper.getCropBlob(data => {
|
||||
let formData = new FormData();
|
||||
formData.append("file", data);
|
||||
upload("image",formData).then(response => {
|
||||
upload(formData).then(response => {
|
||||
open.value = false;
|
||||
options.img = import.meta.env.VITE_APP_BASE_API +"/file/"+response.data[0];
|
||||
options.img = import.meta.env.VITE_APP_BASE_API +"/file/"+response.data[0].id;
|
||||
userStore.avatar = options.img;
|
||||
|
||||
|
||||
|
||||
updateUserProfile({icon:response.data[0]}).then(response2=>{
|
||||
updateUserIcon(response.data[0].id).then(response2=>{
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
visible.value = false;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user