mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-09-21 20:35:16 +00:00
优化配置文件的结构体,优化文件上传与下载功能,系统配置的前端展示更友好及其他的优化
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package upload
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"mime/multipart"
|
||||
)
|
||||
|
||||
var Oss OSS
|
||||
|
||||
type OSS interface {
|
||||
Upload(file *multipart.FileHeader) (string, string, error)
|
||||
DeleteFile(key string) error
|
||||
}
|
||||
|
||||
func InitOss() {
|
||||
switch global.GVA_CONFIG.System.OssType {
|
||||
case "local":
|
||||
Oss = &Local{}
|
||||
case "qiniu":
|
||||
Oss = &Qiniu{}
|
||||
default:
|
||||
Oss = &Local{}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user