Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
5dd9c7f5
Commit
5dd9c7f5
authored
Apr 10, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
邮件发送添加配置
parent
be83b464
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
6 deletions
+23
-6
performance/Performance.Api/appsettings.json
+2
-1
performance/Performance.Api/wwwroot/Performance.Api.xml
+7
-0
performance/Performance.ConsoleApp/Program.cs
+1
-1
performance/Performance.ConsoleApp/appsettings.json
+2
-1
performance/Performance.Extract.Api/appsettings.json
+2
-1
performance/Performance.Infrastructure/Util/EmailService.cs
+7
-0
performance/Performance.Services/AllotService.cs
+1
-1
performance/Performance.Services/DFExtractService.cs
+1
-1
No files found.
performance/Performance.Api/appsettings.json
View file @
5dd9c7f5
...
...
@@ -20,7 +20,8 @@
"EmailOptions"
:
{
"SmtpServer"
:
"smtpdm.aliyun.com"
,
"Account"
:
"service@email.suvalue.com"
,
"Password"
:
"SuValue123456"
"Password"
:
"SuValue123456"
,
"IsEnable"
:
true
},
"Application"
:
{
//登录过期时间
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
5dd9c7f5
...
...
@@ -123,6 +123,13 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.Success(Performance.DtoModels.AllotRequest)"
>
<summary>
生成成功或归档绩效记录
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.Insert(Performance.DtoModels.AllotRequest)"
>
<summary>
新增绩效
...
...
performance/Performance.ConsoleApp/Program.cs
View file @
5dd9c7f5
...
...
@@ -55,7 +55,7 @@ static void Main(string[] args)
var
option
=
services
.
BuildServiceProvider
().
GetService
<
IOptions
<
EmailOptions
>>();
services
.
AddEmailUtil
(
config
=>
{
config
.
Account
=
option
.
Value
.
Account
;
config
.
Password
=
option
.
Value
.
Password
;
config
.
SmtpServer
=
option
.
Value
.
SmtpServer
;
});
services
.
AddEmailUtil
(
config
=>
{
config
.
Account
=
option
.
Value
.
Account
;
config
.
Password
=
option
.
Value
.
Password
;
config
.
SmtpServer
=
option
.
Value
.
SmtpServer
;
config
.
IsEnable
=
option
.
Value
.
IsEnable
;
});
var
emailService
=
services
.
BuildServiceProvider
().
GetService
<
IEmailService
>();
var
message
=
new
EmailMessage
{
...
...
performance/Performance.ConsoleApp/appsettings.json
View file @
5dd9c7f5
...
...
@@ -20,7 +20,8 @@
"EmailOptions"
:
{
"SmtpServer"
:
"smtpdm.aliyun.com"
,
"Account"
:
"service@email.suvalue.com"
,
"Password"
:
"SuValue123456"
"Password"
:
"SuValue123456"
,
"IsEnable"
:
true
},
"Application"
:
{
//登录过期时间
...
...
performance/Performance.Extract.Api/appsettings.json
View file @
5dd9c7f5
...
...
@@ -22,7 +22,8 @@
"EmailOptions"
:
{
"SmtpServer"
:
"smtpdm.aliyun.com"
,
"Account"
:
"service@email.suvalue.com"
,
"Password"
:
"SuValue123456"
"Password"
:
"SuValue123456"
,
"IsEnable"
:
true
},
"Application"
:
{
//登录过期时间
...
...
performance/Performance.Infrastructure/Util/EmailService.cs
View file @
5dd9c7f5
...
...
@@ -25,6 +25,10 @@ public class EmailOptions
/// 密码
/// </summary>
public
string
Password
{
get
;
set
;
}
/// <summary>
/// 是否启用
/// </summary>
public
bool
IsEnable
{
get
;
set
;
}
}
...
...
@@ -80,6 +84,9 @@ public Task<bool> SendAsync(EmailMessage message)
public
bool
Send
(
EmailMessage
message
)
{
if
(!
options
.
IsEnable
)
return
true
;
MailMessage
mail
=
new
MailMessage
();
try
{
...
...
performance/Performance.Services/AllotService.cs
View file @
5dd9c7f5
...
...
@@ -382,7 +382,7 @@ private void SendEmail(per_allot allot, string mail, int type, DateTime time)
$"您可以登录<a href=\"http://jixiao.suvalue.com\" target=\"_blank\">http://jixiao.suvalue.com</a>查看详细清空。</p>"
;
}
//
emailService.SendAsync(message);
emailService
.
SendAsync
(
message
);
}
/// <summary>
...
...
performance/Performance.Services/DFExtractService.cs
View file @
5dd9c7f5
...
...
@@ -937,7 +937,7 @@ private void SendEmail(string mail, string path, string subject, string body)
};
if
(!
string
.
IsNullOrEmpty
(
path
))
message
.
Attachments
=
new
List
<
string
>
{
path
};
//
emailService.Send(message);
emailService
.
Send
(
message
);
}
/// <summary>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment