Merge branch 'master' into dev
This commit is contained in:
commit
e83550aa9c
@ -5,7 +5,9 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using ZR.Admin.WebApi.Filters;
|
using ZR.Admin.WebApi.Filters;
|
||||||
|
using ZR.Service.System.IService;
|
||||||
|
|
||||||
namespace ZR.Admin.WebApi.Controllers
|
namespace ZR.Admin.WebApi.Controllers
|
||||||
{
|
{
|
||||||
@ -15,10 +17,12 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||||
private OptionsSetting OptionsSetting;
|
private OptionsSetting OptionsSetting;
|
||||||
private IWebHostEnvironment WebHostEnvironment;
|
private IWebHostEnvironment WebHostEnvironment;
|
||||||
public UploadController(IOptions<OptionsSetting> optionsSetting, IWebHostEnvironment webHostEnvironment)
|
private ISysFileService SysFileService;
|
||||||
|
public UploadController(IOptions<OptionsSetting> optionsSetting, IWebHostEnvironment webHostEnvironment, ISysFileService fileService)
|
||||||
{
|
{
|
||||||
OptionsSetting = optionsSetting.Value;
|
OptionsSetting = optionsSetting.Value;
|
||||||
WebHostEnvironment = webHostEnvironment;
|
WebHostEnvironment = webHostEnvironment;
|
||||||
|
SysFileService = fileService;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 存储文件
|
/// 存储文件
|
||||||
@ -26,8 +30,8 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
/// <param name="formFile"></param>
|
/// <param name="formFile"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Verify]
|
//[Verify]
|
||||||
[ActionPermissionFilter(Permission = "system")]
|
//[ActionPermissionFilter(Permission = "system")]
|
||||||
public IActionResult SaveFile([FromForm(Name = "file")] IFormFile formFile)
|
public IActionResult SaveFile([FromForm(Name = "file")] IFormFile formFile)
|
||||||
{
|
{
|
||||||
if (formFile == null) throw new CustomException(ResultCode.PARAM_ERROR, "上传图片不能为空");
|
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 fileName = FileUtil.HashFileName(Guid.NewGuid().ToString()).ToLower() + fileExt;
|
||||||
string finalFilePath = Path.Combine(WebHostEnvironment.WebRootPath, FileUtil.GetdirPath("uploads"), fileName);
|
string finalFilePath = Path.Combine(WebHostEnvironment.WebRootPath, FileUtil.GetdirPath("uploads"), fileName);
|
||||||
finalFilePath = finalFilePath.Replace("\\", "/").Replace("//", "/");
|
finalFilePath = finalFilePath.Replace("\\", "/").Replace("//", "/");
|
||||||
|
|
||||||
if (!Directory.Exists(Path.GetDirectoryName(finalFilePath)))
|
if (!Directory.Exists(Path.GetDirectoryName(finalFilePath)))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(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}";
|
string accessPath = $"{OptionsSetting.Upload.UploadUrl}/{FileUtil.GetdirPath("uploads").Replace("\\", " /")}{fileName}";
|
||||||
return ToResponse(ResultCode.SUCCESS, new { accessPath, fullPath = finalFilePath });
|
return ToResponse(ResultCode.SUCCESS, accessPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 存储文件到阿里云
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="formFile"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,10 +24,13 @@
|
|||||||
"UploadDirectory": "/",
|
"UploadDirectory": "/",
|
||||||
"UploadUrl": "http://localhost:8888"
|
"UploadUrl": "http://localhost:8888"
|
||||||
},
|
},
|
||||||
"QIQIU_OSS": {
|
//°¢ÀïÔÆ´æ´¢ÅäÖÃ
|
||||||
|
"ALIYUN_OSS": {
|
||||||
"REGIONID": "cn-hangzhou",
|
"REGIONID": "cn-hangzhou",
|
||||||
"KEY": "XX",
|
"KEY": "XX",
|
||||||
"SECRET": "XX"
|
"SECRET": "XX",
|
||||||
|
"bucketName": "bucketName",
|
||||||
|
"domainUrl": "http://xxx.xxx.com"//·ÃÎÊ×ÊÔ´ÓòÃû
|
||||||
},
|
},
|
||||||
"gen": {
|
"gen": {
|
||||||
"conn": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;user=zr;pwd=abc;database=ZrAdmin;Trusted_Connection=SSPI",
|
"conn": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;user=zr;pwd=abc;database=ZrAdmin;Trusted_Connection=SSPI",
|
||||||
|
|||||||
@ -98,7 +98,8 @@ namespace ZR.CodeGenerator
|
|||||||
{
|
{
|
||||||
sb.AppendLine($" //文件上传成功方法");
|
sb.AppendLine($" //文件上传成功方法");
|
||||||
sb.AppendLine($" handleUpload{dbFieldInfo.CsharpField}Success(res, file) {{");
|
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($" // this.$refs.upload.clearFiles();");
|
||||||
sb.AppendLine($" }},");
|
sb.AppendLine($" }},");
|
||||||
replaceDto.VueBeforeUpload = TplJsBeforeUpload();
|
replaceDto.VueBeforeUpload = TplJsBeforeUpload();
|
||||||
@ -346,7 +347,7 @@ namespace ZR.CodeGenerator
|
|||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.AppendLine(@" //文件上传前判断方法");
|
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();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,12 +94,12 @@ namespace ZR.CodeGenerator
|
|||||||
sb2.AppendLine($" this.{FirstLowerCase(dbFieldInfo.CsharpField)}Options = response.data;");
|
sb2.AppendLine($" this.{FirstLowerCase(dbFieldInfo.CsharpField)}Options = response.data;");
|
||||||
sb2.AppendLine(" })");
|
sb2.AppendLine(" })");
|
||||||
}
|
}
|
||||||
//引用组件
|
//引用组件 已弃用、改用前端全局注册
|
||||||
if (dbFieldInfo.HtmlType == GenConstants.HTML_EDITOR)
|
//if (dbFieldInfo.HtmlType == GenConstants.HTML_EDITOR)
|
||||||
{
|
//{
|
||||||
replaceDto.VueComponent += "Editor,";
|
// replaceDto.VueComponent += "Editor,";
|
||||||
replaceDto.VueComponentImport += "import Editor from '@/components/Editor';\n";
|
// replaceDto.VueComponentImport += "import Editor from '@/components/Editor';\n";
|
||||||
}
|
//}
|
||||||
|
|
||||||
CodeGenerateTemplate.GetQueryDtoProperty(dbFieldInfo, replaceDto);
|
CodeGenerateTemplate.GetQueryDtoProperty(dbFieldInfo, replaceDto);
|
||||||
replaceDto.ModelProperty += CodeGenerateTemplate.GetModelTemplate(dbFieldInfo);
|
replaceDto.ModelProperty += CodeGenerateTemplate.GetModelTemplate(dbFieldInfo);
|
||||||
|
|||||||
47
ZR.Common/AliyunOssHelper.cs
Normal file
47
ZR.Common/AliyunOssHelper.cs
Normal file
@ -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");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传到阿里云
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filestreams"></param>
|
||||||
|
/// <param name="dirPath">存储路径 eg: upload/2020/01/01/xxx.png</param>
|
||||||
|
/// <param name="bucketName">存储桶 如果为空默认取配置文件</param>
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,7 +5,12 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
|
||||||
<PackageReference Include="MailKit" Version="2.15.0" />
|
<PackageReference Include="MailKit" Version="2.15.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,9 +1,24 @@
|
|||||||
using Infrastructure.Attribute;
|
using Infrastructure.Attribute;
|
||||||
using ZR.Model.System;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace ZR.Service.System.IService
|
namespace ZR.Service.System.IService
|
||||||
{
|
{
|
||||||
public interface ISysFileService
|
public interface ISysFileService
|
||||||
{
|
{
|
||||||
|
(bool, string) SaveFile(string picdir, IFormFile formFile);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 按时间来创建文件夹
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path"></param>
|
||||||
|
/// <returns>eg: 2020/11/3</returns>
|
||||||
|
string GetdirPath(string path = "");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 取文件名的MD5值(16位)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">文件名,不包括扩展名</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
string HashFileName(string str = null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,13 @@
|
|||||||
using Infrastructure.Attribute;
|
using Infrastructure.Attribute;
|
||||||
using ZR.Model.System;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using System.IO;
|
||||||
using ZR.Service.System.IService;
|
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
|
namespace ZR.Service.System
|
||||||
{
|
{
|
||||||
@ -10,6 +17,57 @@ namespace ZR.Service.System
|
|||||||
[AppService(ServiceType = typeof(ISysFileService), ServiceLifetime = LifeTime.Transient)]
|
[AppService(ServiceType = typeof(ISysFileService), ServiceLifetime = LifeTime.Transient)]
|
||||||
public class SysFileService : ISysFileService
|
public class SysFileService : ISysFileService
|
||||||
{
|
{
|
||||||
|
private string domainUrl = ConfigUtils.Instance.GetConfig("ALIYUN_OSS:domainUrl");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传文件到阿里云
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="picdir"></param>
|
||||||
|
/// <param name="formFile"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
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("-", "");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,8 @@ import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels,
|
|||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
//自定义表格工具扩展
|
//自定义表格工具扩展
|
||||||
import RightToolbar from "@/components/RightToolbar"
|
import RightToolbar from "@/components/RightToolbar"
|
||||||
|
// 富文本组件
|
||||||
|
import Editor from "@/components/Editor";
|
||||||
// 字典标签组件
|
// 字典标签组件
|
||||||
import DictTag from '@/components/DictTag'
|
import DictTag from '@/components/DictTag'
|
||||||
// 字典数据组件
|
// 字典数据组件
|
||||||
@ -53,7 +55,7 @@ Vue.prototype.msgInfo = function(msg) {
|
|||||||
Vue.component('Pagination', Pagination)
|
Vue.component('Pagination', Pagination)
|
||||||
Vue.component('RightToolbar', RightToolbar)
|
Vue.component('RightToolbar', RightToolbar)
|
||||||
Vue.component('DictTag', DictTag)
|
Vue.component('DictTag', DictTag)
|
||||||
|
Vue.component('Editor', Editor)
|
||||||
Vue.use(permission)
|
Vue.use(permission)
|
||||||
|
|
||||||
Vue.use(Element, {
|
Vue.use(Element, {
|
||||||
|
|||||||
@ -179,7 +179,7 @@ export default {
|
|||||||
// 用户性别选项列表
|
// 用户性别选项列表
|
||||||
sexOptions: [],
|
sexOptions: [],
|
||||||
//文件上传前判断方法
|
//文件上传前判断方法
|
||||||
uploadUrl: process.env.VUE_APP_BASE_API + "/upload/SaveFile/",
|
uploadUrl: process.env.VUE_APP_BASE_API + "upload/SaveFile",
|
||||||
|
|
||||||
// 数据列表
|
// 数据列表
|
||||||
dataList: [],
|
dataList: [],
|
||||||
@ -291,7 +291,8 @@ export default {
|
|||||||
},
|
},
|
||||||
//文件上传成功方法
|
//文件上传成功方法
|
||||||
handleUploadIconSuccess(res, file) {
|
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();
|
// this.$refs.upload.clearFiles();
|
||||||
},
|
},
|
||||||
// 显示状态字典翻译
|
// 显示状态字典翻译
|
||||||
|
|||||||
@ -107,7 +107,6 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
if (this.loginForm.rememberMe) {
|
if (this.loginForm.rememberMe) {
|
||||||
console.log(decrypt(this.loginForm.password));
|
|
||||||
Cookies.set("username", this.loginForm.username, { expires: 30 });
|
Cookies.set("username", this.loginForm.username, { expires: 30 });
|
||||||
Cookies.set("password", this.loginForm.password, {
|
Cookies.set("password", this.loginForm.password, {
|
||||||
expires: 30,
|
expires: 30,
|
||||||
|
|||||||
@ -103,13 +103,9 @@ import {
|
|||||||
updateNotice,
|
updateNotice,
|
||||||
// exportNotice,
|
// exportNotice,
|
||||||
} from "@/api/system/notice";
|
} from "@/api/system/notice";
|
||||||
import Editor from "@/components/Editor";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Notice",
|
name: "Notice",
|
||||||
components: {
|
|
||||||
Editor,
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
|
|||||||
@ -28,11 +28,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import { sendEmail } from "@/api/common";
|
import { sendEmail } from "@/api/common";
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
import Editor from "@/components/Editor";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "sendEmail",
|
name: "sendEmail",
|
||||||
components: { Editor },
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
@ -57,7 +55,6 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(getToken());
|
|
||||||
this.headers.Token = getToken();
|
this.headers.Token = getToken();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -79,7 +76,7 @@ export default {
|
|||||||
console.log(response);
|
console.log(response);
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
this.$message.success("上传成功");
|
this.$message.success("上传成功");
|
||||||
this.form.fileUrl = response.data.fullPath;
|
this.form.fileUrl = response.data;
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(response.msg);
|
this.$message.error(response.msg);
|
||||||
}
|
}
|
||||||
@ -109,6 +106,7 @@ export default {
|
|||||||
loading.close();
|
loading.close();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
} else {
|
} else {
|
||||||
|
console.log('未通过')
|
||||||
//校验不通过
|
//校验不通过
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
1016
ZRAdmin.xml
1016
ZRAdmin.xml
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user