mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-13 04:33:42 +08:00
feat: 注册短信验证码验证功能已经开启
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user