diff --git a/etc/dict.json b/etc/dict.json deleted file mode 100644 index 9e26dfeeb6e641a33dae4961196235bdb965b21b..0000000000000000000000000000000000000000 --- a/etc/dict.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/etc/login-code-email.tpl b/etc/tpl/login-code-email.tpl similarity index 100% rename from etc/login-code-email.tpl rename to etc/tpl/login-code-email.tpl diff --git a/etc/login-code-sms.tpl b/etc/tpl/login-code-sms.tpl similarity index 100% rename from etc/login-code-sms.tpl rename to etc/tpl/login-code-sms.tpl diff --git a/etc/mail.tpl b/etc/tpl/mail.tpl similarity index 100% rename from etc/mail.tpl rename to etc/tpl/mail.tpl diff --git a/etc/password-changed-email.tpl b/etc/tpl/password-changed-email.tpl similarity index 100% rename from etc/password-changed-email.tpl rename to etc/tpl/password-changed-email.tpl diff --git a/etc/sms.tpl b/etc/tpl/sms.tpl similarity index 100% rename from etc/sms.tpl rename to etc/tpl/sms.tpl diff --git a/src/modules/server/http/router_auth.go b/src/modules/server/http/router_auth.go index 80605c79cc82f4fa0eec1e42b37f78cfc50abd19..fcbde44f88334363c0e3112f3af8258e0bfcf3a5 100644 --- a/src/modules/server/http/router_auth.go +++ b/src/modules/server/http/router_auth.go @@ -58,7 +58,7 @@ func getConfigFile(name, ext string) (string, error) { } func init() { - filename, err := getConfigFile("login-code-sms", "tpl") + filename, err := getConfigFile("tpl/login-code-sms", "tpl") if err != nil { log.Fatal(err) } @@ -68,7 +68,7 @@ func init() { log.Fatalf("open %s err: %s", filename, err) } - filename, err = getConfigFile("login-code-email", "tpl") + filename, err = getConfigFile("tpl/login-code-email", "tpl") if err != nil { log.Fatal(err) } @@ -77,7 +77,7 @@ func init() { log.Fatalf("open %s err: %s", filename, err) } - filename, err = getConfigFile("password-changed-email", "tpl") + filename, err = getConfigFile("tpl/password-changed-email", "tpl") if err != nil { log.Fatal(err) } diff --git a/src/modules/server/notify/notify.go b/src/modules/server/notify/notify.go index af1ee6afee7c18fc4ee2ced3664385f45a02168d..9debe58f2fd33024fe1aa241fb2298fc59a6b79b 100644 --- a/src/modules/server/notify/notify.go +++ b/src/modules/server/notify/notify.go @@ -182,7 +182,7 @@ func genContent(isUpgrade bool, events []*models.Event) (string, string) { } // 生成告警邮件 - fp := path.Join(file.SelfDir(), "etc", "mail.tpl") + fp := path.Join(file.SelfDir(), "etc", "tpl", "mail.tpl") t, err := template.ParseFiles(fp) if err != nil { logger.Errorf("InternalServerError: cannot parse %s %v", fp, err) @@ -199,7 +199,7 @@ func genContent(isUpgrade bool, events []*models.Event) (string, string) { } // 生成告警短信,短信和IM复用一个内容模板 - fp = path.Join(file.SelfDir(), "etc", "sms.tpl") + fp = path.Join(file.SelfDir(), "etc", "tpl", "sms.tpl") t, err = template.New("sms.tpl").Funcs(template.FuncMap{ "unescaped": func(str string) interface{} { return template.HTML(str) }, "urlconvert": func(str string) interface{} { return template.URL(str) },