Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
nizhengjia888
gin-vue-admin
提交
373c774f
G
gin-vue-admin
项目概览
nizhengjia888
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
373c774f
编写于
9月 15, 2020
作者:
Sliver_Horn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新配置文件的统一化,并修改zap的level为info
上级
f829f55c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
37 deletion
+30
-37
server/config.yaml
server/config.yaml
+13
-20
server/config/config.go
server/config/config.go
+14
-14
server/utils/email.go
server/utils/email.go
+3
-3
未找到文件。
server/config.yaml
浏览文件 @
373c774f
...
...
@@ -84,33 +84,26 @@ captcha:
img-width
:
240
img-height
:
80
# logger configuration
log
:
prefix
:
'
[GIN-VUE-ADMIN]'
log-file
:
true
stdout
:
'
DEBUG'
file
:
'
DEBUG'
# zap logger configuration
zap
:
# 可使用 "debug", "info", "warn", "error", "dpanic", "panic", "fatal",
level
:
'
debug
'
level
:
'
info
'
# console: 控制台, json: json格式输出
format
:
'
console'
prefix
:
'
[GIN-VUE-ADMIN]'
director
:
'
log'
link
_
name
:
'
latest_log'
show
_
line
:
true
link
-
name
:
'
latest_log'
show
-
line
:
true
# LowercaseLevelEncoder:小写, LowercaseColorLevelEncoder:小写带颜色,CapitalLevelEncoder: 大写, CapitalColorLevelEncoder: 大写带颜色,
encode
_
level
:
'
LowercaseColorLevelEncoder'
stacktrace
_
key
:
'
stacktrace'
log
_in_
console
:
true
encode
-
level
:
'
LowercaseColorLevelEncoder'
stacktrace
-
key
:
'
stacktrace'
log
-in-
console
:
true
email
:
email_from
:
'
xxx@163.com'
email_nick_name
:
'
test'
email_secret
:
'
xxx'
email_to
:
'
xxx@qq.com'
email_host
:
'
smtp.163.com'
email_port
:
465
email_isSSL
:
true
\ No newline at end of file
email-from
:
'
xxx@163.com'
email-nickname
:
'
test'
email-secret
:
'
xxx'
email-to
:
'
xxx@qq.com'
email-host
:
'
smtp.163.com'
email-port
:
465
email-isSSL
:
true
\ No newline at end of file
server/config/config.go
浏览文件 @
373c774f
...
...
@@ -79,8 +79,8 @@ type Redis struct {
}
type
LocalUpload
struct
{
Local
bool
`mapstructure:"local" json:"local" yaml:"local"`
FilePath
string
`mapstructure:"file-path" json:"filePath" yaml:"file-path"`
Local
bool
`mapstructure:"local" json:"local" yaml:"local"`
FilePath
string
`mapstructure:"file-path" json:"filePath" yaml:"file-path"`
}
type
Qiniu
struct
{
...
...
@@ -101,19 +101,19 @@ type Zap struct {
Format
string
`mapstructure:"format" json:"format" yaml:"format"`
Prefix
string
`mapstructure:"prefix" json:"prefix" yaml:"prefix"`
Director
string
`mapstructure:"director" json:"director" yaml:"director"`
LinkName
string
`mapstructure:"link
_name" json:"linkName" yaml:"link_
name"`
ShowLine
bool
`mapstructure:"show
_
line" json:"showLine" yaml:"showLine"`
EncodeLevel
string
`mapstructure:"encode
_level" json:"encodeLevel" yaml:"encode_
level"`
StacktraceKey
string
`mapstructure:"stacktrace
_key" json:"stacktraceKey" yaml:"stacktrace_
key"`
LogInConsole
bool
`mapstructure:"log
_in_console" json:"logInConsole" yaml:"log_in_
console"`
LinkName
string
`mapstructure:"link
-name" json:"linkName" yaml:"link-
name"`
ShowLine
bool
`mapstructure:"show
-
line" json:"showLine" yaml:"showLine"`
EncodeLevel
string
`mapstructure:"encode
-level" json:"encodeLevel" yaml:"encode-
level"`
StacktraceKey
string
`mapstructure:"stacktrace
-key" json:"stacktraceKey" yaml:"stacktrace-
key"`
LogInConsole
bool
`mapstructure:"log
-in-console" json:"logInConsole" yaml:"log-in-
console"`
}
type
Email
struct
{
EmailFrom
string
`mapstructure:"email_from" json:"emailFrom" yaml:"email_
from"`
EmailNick
Name
string
`mapstructure:"email_nick_name" json:"emailNickName" yaml:"email_nick_
name"`
EmailSecret
string
`mapstructure:"email_secret" json:"emailSecret" yaml:"email_
secret"`
EmailTo
string
`mapstructure:"email_to" json:"emailTo" yaml:"email_
to"`
EmailHost
string
`mapstructure:"email_host" json:"emailHost" yaml:"email_
host"`
EmailPort
int
`mapstructure:"email_port" json:"emailPort" yaml:"email_
port"`
EmailIsSSL
bool
`mapstructure:"email_isSSL" json:"emailIsSSL" yaml:"email_isSSL
"`
EmailFrom
string
`mapstructure:"email-from" json:"emailFrom" yaml:"email-
from"`
EmailNick
name
string
`mapstructure:"email-nickname" json:"emailNickname" yaml:"email-nick
name"`
EmailSecret
string
`mapstructure:"email-secret" json:"emailSecret" yaml:"email-
secret"`
EmailTo
string
`mapstructure:"email-to" json:"emailTo" yaml:"email-
to"`
EmailHost
string
`mapstructure:"email-host" json:"emailHost" yaml:"email-
host"`
EmailPort
int
`mapstructure:"email-port" json:"emailPort" yaml:"email-
port"`
EmailIsSSL
bool
`mapstructure:"email-is-ssl" json:"emailIsSSL" yaml:"email-is-ssl
"`
}
server/utils/email.go
浏览文件 @
373c774f
...
...
@@ -23,7 +23,7 @@ func EmailTest(subject string, body string) error {
func
send
(
to
[]
string
,
subject
string
,
body
string
)
error
{
from
:=
global
.
GVA_CONFIG
.
Email
.
EmailFrom
nick
Name
:=
global
.
GVA_CONFIG
.
Email
.
EmailNickN
ame
nick
name
:=
global
.
GVA_CONFIG
.
Email
.
EmailNickn
ame
secret
:=
global
.
GVA_CONFIG
.
Email
.
EmailSecret
host
:=
global
.
GVA_CONFIG
.
Email
.
EmailHost
port
:=
global
.
GVA_CONFIG
.
Email
.
EmailPort
...
...
@@ -31,8 +31,8 @@ func send(to []string, subject string, body string) error {
auth
:=
smtp
.
PlainAuth
(
""
,
from
,
secret
,
host
)
e
:=
email
.
NewEmail
()
if
nick
N
ame
!=
""
{
e
.
From
=
fmt
.
Sprintf
(
"%s <%s>"
,
nick
N
ame
,
from
)
if
nick
n
ame
!=
""
{
e
.
From
=
fmt
.
Sprintf
(
"%s <%s>"
,
nick
n
ame
,
from
)
}
else
{
e
.
From
=
from
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录