feat: 注册短信验证码验证功能已经开启

This commit is contained in:
RockYang
2023-07-02 20:51:13 +08:00
parent a2b1924e00
commit 72cc6f3d75
21 changed files with 457 additions and 53 deletions

View File

@@ -47,7 +47,7 @@ func (h *UploadHandler) Upload(c *gin.Context) {
// 生成上传文件路径
func (h *UploadHandler) genFilePath(filename string) (string, error) {
now := time.Now()
dir := fmt.Sprintf("%s/upload/%d/%d", h.App.AppConfig.StaticDir, now.Year(), now.Month())
dir := fmt.Sprintf("%s/upload/%d/%d", h.App.Config.StaticDir, now.Year(), now.Month())
_, err := os.Stat(dir)
if err != nil {
err = os.MkdirAll(dir, 0755)
@@ -63,5 +63,5 @@ func (h *UploadHandler) genFilePath(filename string) (string, error) {
func (h *UploadHandler) genFileUrl(filePath string) string {
now := time.Now()
filename := filepath.Base(filePath)
return fmt.Sprintf("%s/upload/%d/%d/%s", h.App.AppConfig.StaticUrl, now.Year(), now.Month(), filename)
return fmt.Sprintf("%s/upload/%d/%d/%s", h.App.Config.StaticUrl, now.Year(), now.Month(), filename)
}