From 3c9e0a7569ea012e665d0b690fda7eeaa06516d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Mon, 29 Nov 2021 13:46:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=96=87=E4=BB=B6=E5=88=B0=E9=98=BF=E9=87=8C=E4=BA=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/UploadController.cs | 43 +++++++++++-- ZR.Admin.WebApi/appsettings.json | 7 ++- ZR.CodeGenerator/CodeGenerateTemplate.cs | 5 +- ZR.Common/AliyunOssHelper.cs | 47 +++++++++++++++ ZR.Common/ZR.Common.csproj | 5 ++ ZR.Service/System/IService/ISysFileService.cs | 17 +++++- ZR.Service/System/SysFileService.cs | 60 ++++++++++++++++++- ZR.Vue/src/views/business/gendemo/index.vue | 5 +- 8 files changed, 176 insertions(+), 13 deletions(-) create mode 100644 ZR.Common/AliyunOssHelper.cs diff --git a/ZR.Admin.WebApi/Controllers/UploadController.cs b/ZR.Admin.WebApi/Controllers/UploadController.cs index 3762e45..7702b11 100644 --- a/ZR.Admin.WebApi/Controllers/UploadController.cs +++ b/ZR.Admin.WebApi/Controllers/UploadController.cs @@ -5,7 +5,9 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using System; using System.IO; +using System.Linq; using ZR.Admin.WebApi.Filters; +using ZR.Service.System.IService; namespace ZR.Admin.WebApi.Controllers { @@ -15,10 +17,12 @@ namespace ZR.Admin.WebApi.Controllers private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); private OptionsSetting OptionsSetting; private IWebHostEnvironment WebHostEnvironment; - public UploadController(IOptions optionsSetting, IWebHostEnvironment webHostEnvironment) + private ISysFileService SysFileService; + public UploadController(IOptions optionsSetting, IWebHostEnvironment webHostEnvironment, ISysFileService fileService) { OptionsSetting = optionsSetting.Value; WebHostEnvironment = webHostEnvironment; + SysFileService = fileService; } /// /// 存储文件 @@ -26,8 +30,8 @@ namespace ZR.Admin.WebApi.Controllers /// /// [HttpPost] - [Verify] - [ActionPermissionFilter(Permission = "system")] + //[Verify] + //[ActionPermissionFilter(Permission = "system")] public IActionResult SaveFile([FromForm(Name = "file")] IFormFile formFile) { if (formFile == null) throw new CustomException(ResultCode.PARAM_ERROR, "上传图片不能为空"); @@ -35,7 +39,7 @@ namespace ZR.Admin.WebApi.Controllers string fileName = FileUtil.HashFileName(Guid.NewGuid().ToString()).ToLower() + fileExt; string finalFilePath = Path.Combine(WebHostEnvironment.WebRootPath, FileUtil.GetdirPath("uploads"), fileName); finalFilePath = finalFilePath.Replace("\\", "/").Replace("//", "/"); - + if (!Directory.Exists(Path.GetDirectoryName(finalFilePath))) { Directory.CreateDirectory(Path.GetDirectoryName(finalFilePath)); @@ -47,7 +51,36 @@ namespace ZR.Admin.WebApi.Controllers } string accessPath = $"{OptionsSetting.Upload.UploadUrl}/{FileUtil.GetdirPath("uploads").Replace("\\", " /")}{fileName}"; - return ToResponse(ResultCode.SUCCESS, new { accessPath, fullPath = finalFilePath }); + return ToResponse(ResultCode.SUCCESS, accessPath); + } + + /// + /// 存储文件到阿里云 + /// + /// + /// + [HttpPost] + //[Verify] + //[ActionPermissionFilter(Permission = "system")] + public IActionResult SaveFileAliyun([FromForm(Name = "file")] IFormFile formFile) + { + if (formFile == null) throw new CustomException(ResultCode.PARAM_ERROR, "上传文件不能为空"); + string fileExt = Path.GetExtension(formFile.FileName); + string[] AllowedFileExtensions = new string[] { ".jpg", ".gif", ".png", ".jpeg", ".webp", ".svga", ".xls" }; + int MaxContentLength = 1024 * 1024 * 4; + + if (!AllowedFileExtensions.Contains(fileExt)) + { + return ToResponse(ResultCode.CUSTOM_ERROR, "上传失败,未经允许上传类型"); + } + + if (formFile.Length > MaxContentLength) + { + return ToResponse(ResultCode.CUSTOM_ERROR, "上传文件过大,不能超过 " + (MaxContentLength / 1024).ToString() + " MB"); + } + (bool, string) result = SysFileService.SaveFile("", formFile); + + return ToResponse(ResultCode.SUCCESS, result.Item2); } } } diff --git a/ZR.Admin.WebApi/appsettings.json b/ZR.Admin.WebApi/appsettings.json index eaafb97..58dd587 100644 --- a/ZR.Admin.WebApi/appsettings.json +++ b/ZR.Admin.WebApi/appsettings.json @@ -24,10 +24,13 @@ "UploadDirectory": "/", "UploadUrl": "http://localhost:8888" }, - "QIQIU_OSS": { + //ƴ洢 + "ALIYUN_OSS": { "REGIONID": "cn-hangzhou", "KEY": "XX", - "SECRET": "XX" + "SECRET": "XX", + "bucketName": "bucketName", + "domainUrl": "http://xxx.xxx.com"//Դ }, "gen": { "conn": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;user=zr;pwd=abc;database=ZrAdmin;Trusted_Connection=SSPI", diff --git a/ZR.CodeGenerator/CodeGenerateTemplate.cs b/ZR.CodeGenerator/CodeGenerateTemplate.cs index 3914017..1f97147 100644 --- a/ZR.CodeGenerator/CodeGenerateTemplate.cs +++ b/ZR.CodeGenerator/CodeGenerateTemplate.cs @@ -98,7 +98,8 @@ namespace ZR.CodeGenerator { sb.AppendLine($" //文件上传成功方法"); sb.AppendLine($" handleUpload{dbFieldInfo.CsharpField}Success(res, file) {{"); - sb.AppendLine($" this.form.{columnName} = URL.createObjectURL(file.raw);"); + sb.AppendLine($" this.form.{columnName} = res.data;"); + sb.AppendLine($" // this.form.{columnName} = URL.createObjectURL(file.raw);"); sb.AppendLine($" // this.$refs.upload.clearFiles();"); sb.AppendLine($" }},"); replaceDto.VueBeforeUpload = TplJsBeforeUpload(); @@ -346,7 +347,7 @@ namespace ZR.CodeGenerator { StringBuilder sb = new StringBuilder(); sb.AppendLine(@" //文件上传前判断方法"); - sb.AppendLine(@" uploadUrl: process.env.VUE_APP_BASE_API + ""/upload/SaveFile/"","); + sb.AppendLine(@" uploadUrl: process.env.VUE_APP_BASE_API + ""upload/SaveFile"","); return sb.ToString(); } diff --git a/ZR.Common/AliyunOssHelper.cs b/ZR.Common/AliyunOssHelper.cs new file mode 100644 index 0000000..8510317 --- /dev/null +++ b/ZR.Common/AliyunOssHelper.cs @@ -0,0 +1,47 @@ +using Aliyun.OSS; +using Aliyun.OSS.Common; +using Infrastructure; +using System; +using System.IO; + +namespace ZR.Common +{ + public class AliyunOssHelper + { + static string accessKeyId = ConfigUtils.Instance.GetConfig("ALIYUN_OSS:KEY"); + static string accessKeySecret = ConfigUtils.Instance.GetConfig("ALIYUN_OSS:SECRET"); + static string endpoint = ConfigUtils.Instance.GetConfig("ALIYUN_OSS:REGIONID"); + static string bucketName1 = ConfigUtils.Instance.GetConfig("ALIYUN_OSS:bucketName"); + + /// + /// 上传到阿里云 + /// + /// + /// 存储路径 eg: upload/2020/01/01/xxx.png + /// 存储桶 如果为空默认取配置文件 + public static System.Net.HttpStatusCode PutObjectFromFile(Stream filestreams, string dirPath, string bucketName = "") + { + OssClient client = new OssClient(endpoint, accessKeyId, accessKeySecret); + if (string.IsNullOrEmpty(bucketName)) { bucketName = bucketName1; } + try + { + dirPath = dirPath.Replace("\\", "/"); + PutObjectResult putObjectResult = client.PutObject(bucketName, dirPath, filestreams); + // Console.WriteLine("Put object:{0} succeeded", directory); + + return putObjectResult.HttpStatusCode; + } + catch (OssException ex) + { + Console.WriteLine("Failed with error code: {0}; Error info: {1}. \nRequestID:{2}\tHostID:{3}", + ex.ErrorCode, ex.Message, ex.RequestId, ex.HostId); + } + catch (Exception ex) + { + Console.WriteLine("Failed with error info: {0}", ex.Message); + } + return System.Net.HttpStatusCode.BadRequest; + } + + } +} diff --git a/ZR.Common/ZR.Common.csproj b/ZR.Common/ZR.Common.csproj index 988d309..1bffb47 100644 --- a/ZR.Common/ZR.Common.csproj +++ b/ZR.Common/ZR.Common.csproj @@ -5,7 +5,12 @@ + + + + + diff --git a/ZR.Service/System/IService/ISysFileService.cs b/ZR.Service/System/IService/ISysFileService.cs index 99daf07..ff1b047 100644 --- a/ZR.Service/System/IService/ISysFileService.cs +++ b/ZR.Service/System/IService/ISysFileService.cs @@ -1,9 +1,24 @@ using Infrastructure.Attribute; -using ZR.Model.System; +using Microsoft.AspNetCore.Http; namespace ZR.Service.System.IService { public interface ISysFileService { + (bool, string) SaveFile(string picdir, IFormFile formFile); + + /// + /// 按时间来创建文件夹 + /// + /// + /// eg: 2020/11/3 + string GetdirPath(string path = ""); + + /// + /// 取文件名的MD5值(16位) + /// + /// 文件名,不包括扩展名 + /// + string HashFileName(string str = null); } } diff --git a/ZR.Service/System/SysFileService.cs b/ZR.Service/System/SysFileService.cs index 7a0741d..7a78c8b 100644 --- a/ZR.Service/System/SysFileService.cs +++ b/ZR.Service/System/SysFileService.cs @@ -1,6 +1,13 @@ using Infrastructure.Attribute; -using ZR.Model.System; +using Microsoft.AspNetCore.Http; +using System.IO; using ZR.Service.System.IService; +using ZR.Common; +using Infrastructure; +using System; +using System.Text; +using System.Security.Cryptography; +using System.Net; namespace ZR.Service.System { @@ -10,6 +17,57 @@ namespace ZR.Service.System [AppService(ServiceType = typeof(ISysFileService), ServiceLifetime = LifeTime.Transient)] public class SysFileService : ISysFileService { + private string domainUrl = ConfigUtils.Instance.GetConfig("ALIYUN_OSS:domainUrl"); + + /// + /// 上传文件到阿里云 + /// + /// + /// + /// + public (bool, string) SaveFile(string picdir, IFormFile formFile) + { + // eg: idcard/2020/08/18 + string dir = GetdirPath(picdir.ToString()); + string tempName = HashFileName(); + string fileExt = Path.GetExtension(formFile.FileName); + string fileName = $"{tempName}{fileExt}"; + string webUrl = $"{domainUrl}/{dir}/{fileName}"; + + HttpStatusCode statusCode = AliyunOssHelper.PutObjectFromFile(formFile.OpenReadStream(), Path.Combine(dir, fileName)); + + if (statusCode == HttpStatusCode.OK) + { + return (true, webUrl); + } + return (false, ""); + } + + public string GetdirPath(string path = "") + { + DateTime date = DateTime.Now; + int year = date.Year; + int month = date.Month; + int day = date.Day; + //int hour = date.Hour; + + string timeDir = $"{year}/{month}/{day}";// date.ToString("yyyyMM/dd/HH/"); + if (!string.IsNullOrEmpty(path)) + { + timeDir = path + "/" + timeDir; + } + return timeDir; + } + + public string HashFileName(string str = null) + { + if (string.IsNullOrEmpty(str)) + { + str = Guid.NewGuid().ToString(); + } + MD5CryptoServiceProvider md5 = new(); + return BitConverter.ToString(md5.ComputeHash(Encoding.Default.GetBytes(str)), 4, 8).Replace("-", ""); + } } } diff --git a/ZR.Vue/src/views/business/gendemo/index.vue b/ZR.Vue/src/views/business/gendemo/index.vue index f543ac0..614f3ea 100644 --- a/ZR.Vue/src/views/business/gendemo/index.vue +++ b/ZR.Vue/src/views/business/gendemo/index.vue @@ -179,7 +179,7 @@ export default { // 用户性别选项列表 sexOptions: [], //文件上传前判断方法 - uploadUrl: process.env.VUE_APP_BASE_API + "/upload/SaveFile/", + uploadUrl: process.env.VUE_APP_BASE_API + "upload/SaveFile", // 数据列表 dataList: [], @@ -291,7 +291,8 @@ export default { }, //文件上传成功方法 handleUploadIconSuccess(res, file) { - this.form.icon = URL.createObjectURL(file.raw); + this.form.icon = res.data; + // this.form.icon = URL.createObjectURL(file.raw); // this.$refs.upload.clearFiles(); }, // 显示状态字典翻译 From 431c1460e6334008f527702c7acc3bbae91b8b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Mon, 29 Nov 2021 13:50:50 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=20ZRAdmin.xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZRAdmin.xml | 1016 --------------------------------------------------- 1 file changed, 1016 deletions(-) delete mode 100644 ZRAdmin.xml diff --git a/ZRAdmin.xml b/ZRAdmin.xml deleted file mode 100644 index 270066e..0000000 --- a/ZRAdmin.xml +++ /dev/null @@ -1,1016 +0,0 @@ - - - - ZR.Admin.WebApi - - - - - json输出带时间格式的 - - - - - - - - 响应返回结果 - - 受影响行数 - - - - - 全局Code使用 - - - - - - - - 代码生成演示Controller - - @author zr - @date 2021-10-10 - - - - - 代码生成演示接口 - - - - - 查询代码生成演示列表 - - - - - - 查询代码生成演示详情 - - - - - - - 添加代码生成演示 - - - - - - 更新代码生成演示 - - - - - - 删除代码生成演示 - - - - - - 代码生成 - - - - - 获取所有数据库的信息 - - - - - - 获取所有表根据数据名 - - 数据库名 - 表名 - 分页信息 - - - - - 代码生成器 - - 数据传输对象 - - - - - 获取代码生成表列表 - - 表名 - 分页信息 - - - - - 查询表字段列表 - - genTable表id - - - - - 删除代码生成 - - - - - - - 导入表结构(保存) - - - - - - - - 修改保存代码生成业务 - - 请求参数实体 - - - - - 预览代码 - - - - - - - 心跳 - - - - - - 加密 - - - - - - - 解密 - - - - - - - 发送邮件 - - 请求参数接收实体 - - - - - T4代码自动生成 - - - - - 文章接口 - - - - - 查询文章列表 - - - - - - 获取文章目录,前端没用到 - - - - - - 获取文章目录树 - - - - - - 查询文章详情 - - - - - - - 添加文章 - - - - - - 更新文章 - - - - - - 删除文章 - - - - - - 获取缓存监控数据 - - - - - - 获取服务器信息 - - - - - - 系统访问记录 - - - - - 查询登录日志 - /monitor/logininfor/list - - - - - - - - 清空登录日志 - /monitor/logininfor/clean - - - - - - /monitor/logininfor/1 - - - - - - - 查询操作日志 - - - - - - - 删除操作日志 - - - - - - - 清空操作日志 - - - - - - 参数配置Controller - - @author zhaorui - @date 2021-09-29 - - - - - 参数配置接口 - - - - - 查询参数配置列表 - - - - - - 查询参数配置详情 - - - - - - - 根据参数键名查询参数值 - - - - - - - 添加参数配置 - - - - - - 更新参数配置 - - - - - - 删除参数配置 - - - - - - 部门 - - - - - 获取部门列表 - - - - - - 查询部门列表(排除节点) - - - - - - - 获取部门下拉树列表 - - - - - - - 根据部门编号获取详细信息 - - - - - - 新增部门 - - - - - - - 修改部门 - - - - - - - 删除部门 - - - - - - 数据字典信息 - @author zr - - - - - 搜索 - - - - - - - - 根据字典类型查询字典数据信息 - - - - - - - 查询字典数据详细 - - - - - - - 添加 - - - - - - - 修改 - - - - - - - 删除字典类型 - - - - - - - 数据字典信息 - - - - - 查询 - - - - - - - - 查询字典类型详细 - - - - - - - 添加字典类型 - - - - - - - 修改字典类型 - - - - - - - 删除字典类型 - - - - - - 登录 - - - - - 登录 - - 登录对象 - - - - - 注销 - - - - - - 获取用户信息 - - - - - - 获取路由信息 - - - - - - 生成图片验证码 - - - - - - 获取菜单列表 √ - - - - - - 根据菜单编号获取详细信息 √ - - - - - - - 获取菜单下拉树列表(分配角色所需菜单) - - - - - - 获取角色菜单信息 - 加载对应角色菜单列表树 - - - - - - - 修改菜单 √ - - - - - - - 添加菜单 √ - - - - - - - 菜单删除 √ - - - - - - - 保存排序 - - - - - - - 岗位管理 - - - - - 岗位列表查询 - - - - - - 岗位查询 - - - - - - - 岗位管理 - - - - - - - 岗位管理 - - - - - - - 岗位删除 - - - - - - - 获取岗位选择框列表 - - - - - 个人中心用户信息获取 - - - - - - 修改用户 - - - - - - 修改密码 - - - - - - 修改头像 - - - - - - 角色信息 - - - - - 获取系统角色管理 - - - - - - 根据角色编号获取详细信息 - - - - - - - 添加角色 √ - - - - - - - 修改角色 √ - - - - - - - 根据角色分配菜单 - - - - - - - 角色删除 √ - - - - - - - 修改角色状态 √ - - 角色对象 - - - - - 用户管理 -> 获取用户 - /system/user/list - - - - - - 用户管理 -> 编辑、添加用户获取用户,信息查询 - - - - - - - 添加用户 - - - - - - - 修改用户 - - - - - - - 改变用户状态 - - - - - - - 删除用户 - - - - - - - 重置密码 - - - - - - 导入 ok - - 使用IFromFile必须使用name属性否则获取不到文件 - - - - - 用户模板 ok - - - - - - 根据角色编号获取已分配的用户 - - - - - - - 添加角色用户 - - - - - - 删除角色用户 - - - - - - - 获取未分配用户角色 - - - - - - - 查询日志 - - - - - - - - 删除定时任务调用日志 - - - - - - - 清空日志 - - - - - - 计划任务 - - - - - 查询计划任务列表 - - - - - - 查询单个计划任务 - - 编码 - - - - - 添加任务 - - - - - - 更新任务 - - - - - - 删除任务 - - - - - - 启动任务 - - - - - - 停止任务 - - - - - - 定时任务立即执行一次 - - - - - - - 存储文件 - - - - - - - HttpContext扩展类 - - - - - 是否是ajax请求 - - - - - - - 获取客户端IP - - - - - - - 获取请求令牌 - - - - - - - 登录cookie写入 - - - - - - - - 定时任务扩展方法 - - - - - 程序启动后添加任务计划 - - - - - - - API授权判断 - - - - - 权限字符串,例如 system:user:view - - - - - 执行Action前校验是否有权限访问 - - - - - - - - OnActionExecuting是在Action执行之前运行的方法。 - - - - - - OnActionExecuted是在Action中的代码执行之后运行的方法。 - - - - - - 记录请求,输出日志 - - - - - OnActionExecuted是在Action中的代码执行之后运行的方法。 - - - - - - 设置请求参数 - - - - - - - 授权校验访问 - 如果跳过授权登录在Action 或controller加上 AllowAnonymousAttribute - - - - - 只判断token是否正确,不判断权限 - 如果需要判断权限的在Action上加上ApiActionPermission属性标识权限类别,ActionPermissionFilter作权限处理 - - - - - - 记录用户登陆信息 - - - - - - - - - 2020-11-20 - - - - - 获取用户身份信息 - - - - - - - 生成token - - - - - - - 从令牌中获取数据声明 - - 令牌 - - - - - jwt token校验 - - - - - - - - 注册Services服务 - - - - - From 5e65941e15c8f1569990f4be4cb8a9e6a40d6254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Mon, 29 Nov 2021 20:13:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BB=84?= =?UTF-8?q?=E4=BB=B6Editor=20=E6=94=B9=E7=94=A8=E5=85=A8=E5=B1=80=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=EF=BC=8C=E7=A7=BB=E9=99=A4=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=8D=95=E7=8B=AC=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.CodeGenerator/CodeGeneratorTool.cs | 12 ++++++------ ZR.Vue/src/main.js | 4 +++- ZR.Vue/src/views/login.vue | 1 - ZR.Vue/src/views/system/notice/index.vue | 4 ---- ZR.Vue/src/views/tool/email/sendEmail.vue | 6 ++---- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/ZR.CodeGenerator/CodeGeneratorTool.cs b/ZR.CodeGenerator/CodeGeneratorTool.cs index 22555fc..35aa113 100644 --- a/ZR.CodeGenerator/CodeGeneratorTool.cs +++ b/ZR.CodeGenerator/CodeGeneratorTool.cs @@ -93,12 +93,12 @@ namespace ZR.CodeGenerator sb2.AppendLine($" this.{FirstLowerCase(dbFieldInfo.CsharpField)}Options = response.data;"); sb2.AppendLine(" })"); } - //引用组件 - if (dbFieldInfo.HtmlType == GenConstants.HTML_EDITOR) - { - replaceDto.VueComponent += "Editor,"; - replaceDto.VueComponentImport += "import Editor from '@/components/Editor';\n"; - } + //引用组件 已弃用、改用前端全局注册 + //if (dbFieldInfo.HtmlType == GenConstants.HTML_EDITOR) + //{ + // replaceDto.VueComponent += "Editor,"; + // replaceDto.VueComponentImport += "import Editor from '@/components/Editor';\n"; + //} CodeGenerateTemplate.GetQueryDtoProperty(dbFieldInfo, replaceDto); replaceDto.ModelProperty += CodeGenerateTemplate.GetModelTemplate(dbFieldInfo); diff --git a/ZR.Vue/src/main.js b/ZR.Vue/src/main.js index 4bb5702..38f615a 100644 --- a/ZR.Vue/src/main.js +++ b/ZR.Vue/src/main.js @@ -21,6 +21,8 @@ import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, import Pagination from "@/components/Pagination"; //自定义表格工具扩展 import RightToolbar from "@/components/RightToolbar" +// 富文本组件 +import Editor from "@/components/Editor"; // 字典标签组件 import DictTag from '@/components/DictTag' // 字典数据组件 @@ -53,7 +55,7 @@ Vue.prototype.msgInfo = function(msg) { Vue.component('Pagination', Pagination) Vue.component('RightToolbar', RightToolbar) Vue.component('DictTag', DictTag) - +Vue.component('Editor', Editor) Vue.use(permission) Vue.use(Element, { diff --git a/ZR.Vue/src/views/login.vue b/ZR.Vue/src/views/login.vue index 5bfdd0e..edfe6bc 100644 --- a/ZR.Vue/src/views/login.vue +++ b/ZR.Vue/src/views/login.vue @@ -107,7 +107,6 @@ export default { if (valid) { this.loading = true; if (this.loginForm.rememberMe) { - console.log(decrypt(this.loginForm.password)); Cookies.set("username", this.loginForm.username, { expires: 30 }); Cookies.set("password", this.loginForm.password, { expires: 30, diff --git a/ZR.Vue/src/views/system/notice/index.vue b/ZR.Vue/src/views/system/notice/index.vue index a2e73b4..05f9735 100644 --- a/ZR.Vue/src/views/system/notice/index.vue +++ b/ZR.Vue/src/views/system/notice/index.vue @@ -103,13 +103,9 @@ import { updateNotice, // exportNotice, } from "@/api/system/notice"; -import Editor from "@/components/Editor"; export default { name: "Notice", - components: { - Editor, - }, data() { return { // 遮罩层 diff --git a/ZR.Vue/src/views/tool/email/sendEmail.vue b/ZR.Vue/src/views/tool/email/sendEmail.vue index aa5413b..02bdb5e 100644 --- a/ZR.Vue/src/views/tool/email/sendEmail.vue +++ b/ZR.Vue/src/views/tool/email/sendEmail.vue @@ -28,11 +28,9 @@