fix(be):使用next-terminal 自定义的日志

This commit is contained in:
neverteaser
2021-03-19 22:58:47 +08:00
committed by dushixiang
parent 518e665d17
commit 9d38e5fef7
19 changed files with 322 additions and 184 deletions

View File

@ -3,11 +3,11 @@ package service
import (
"net/smtp"
"next-terminal/pkg/log"
"next-terminal/server/constant"
"next-terminal/server/repository"
"github.com/jordan-wright/email"
"github.com/sirupsen/logrus"
)
type MailService struct {
@ -26,7 +26,7 @@ func (r MailService) SendMail(to, subject, text string) {
password := propertiesMap[constant.MailPassword]
if host == "" || port == "" || username == "" || password == "" {
logrus.Debugf("邮箱信息不完整,跳过发送邮件。")
log.Debugf("邮箱信息不完整,跳过发送邮件。")
return
}
@ -37,6 +37,6 @@ func (r MailService) SendMail(to, subject, text string) {
e.Text = []byte(text)
err := e.Send(host+":"+port, smtp.PlainAuth("", username, password, host))
if err != nil {
logrus.Errorf("邮件发送失败: %v", err.Error())
log.Errorf("邮件发送失败: %v", err.Error())
}
}