Jelajahi Sumber

插件按装路径修复

yxh 4 tahun lalu
induk
melakukan
779ad443f9
1 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 2 3
      app/system/service/plugins_manage.go

+ 2 - 3
app/system/service/plugins_manage.go

@@ -14,7 +14,6 @@ import (
 	"gfast/app/common/global"
 	"gfast/app/system/dao"
 	"gfast/app/system/model"
-	"gfast/library"
 	"github.com/gogf/gf/container/garray"
 	"github.com/gogf/gf/container/gmap"
 	"github.com/gogf/gf/encoding/gcompress"
@@ -374,7 +373,7 @@ func (s *pluginsManage) downloadAndInstall(ctx context.Context, url string) erro
 // InstallFile 安装插件文件
 func (s *pluginsManage) InstallFile(ctx context.Context, data []byte, fileName string) (err error) {
 	//获取插件下载路径
-	downloadPath := library.GetExcPath() + "/data/installPlugins"
+	downloadPath := gfile.MainPkgPath() + "/data/installPlugins"
 	if !gfile.IsDir(downloadPath) {
 		err = gfile.Mkdir(downloadPath)
 		if err != nil {
@@ -411,7 +410,7 @@ func (s *pluginsManage) InstallFile(ctx context.Context, data []byte, fileName s
 	}
 	//复制插件文件到对应目录
 	//1.后端
-	err = gfile.Copy(downloadPath+"/"+fileName+"/go/", library.GetExcPath())
+	err = gfile.Copy(downloadPath+"/"+fileName+"/go/", gfile.MainPkgPath())
 	if err != nil {
 		return
 	}