Skip to content

Commit 630300c

Browse files
author
pixel
committed
修改email基础配置数据
1 parent fd0f741 commit 630300c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

server/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jwt:
1111
# mysql connect configuration
1212
mysql:
1313
username: root
14-
password: 'root'
14+
password: 'Aa@6447985'
1515
path: '127.0.0.1:3306'
1616
db-name: 'qmPlus'
1717
config: 'charset=utf8mb4&parseTime=True&loc=Local'

server/utils/email.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package utils
22

33
import (
4+
"crypto/tls"
45
"fmt"
5-
"strings"
66
"net/smtp"
7-
"crypto/tls"
7+
"strings"
88

99
"gin-vue-admin/global"
1010

@@ -31,9 +31,9 @@ func send(to []string, subject string, body string) error {
3131

3232
auth := smtp.PlainAuth("", from, secret, host)
3333
e := email.NewEmail()
34-
if nickName == "" {
34+
if nickName != "" {
3535
e.From = fmt.Sprintf("%s <%s>", nickName, from)
36-
}else{
36+
} else {
3737
e.From = from
3838
}
3939
e.To = to
@@ -43,8 +43,8 @@ func send(to []string, subject string, body string) error {
4343
hostAddr := fmt.Sprintf("%s:%d", host, port)
4444
if isSSL {
4545
err = e.SendWithTLS(hostAddr, auth, &tls.Config{ServerName: host})
46-
}else{
46+
} else {
4747
err = e.Send(hostAddr, auth)
4848
}
4949
return err
50-
}
50+
}

0 commit comments

Comments
 (0)