Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
admpub committed Sep 11, 2024
1 parent 1f7801b commit 28cabfb
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 104 deletions.
21 changes: 11 additions & 10 deletions application/handler/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ import (
"github.com/webx-top/com"
"github.com/webx-top/echo"

"github.com/admpub/nging/v5/application/handler"
"github.com/admpub/nging/v5/application/library/config"
"github.com/admpub/nging/v5/application/library/filemanager"
"github.com/admpub/nging/v5/application/library/notice"
"github.com/admpub/nging/v5/application/library/respond"
"github.com/coscms/webcore/library/backend"
"github.com/coscms/webcore/library/common"
"github.com/coscms/webcore/library/config"
"github.com/coscms/webcore/library/filemanager"
"github.com/coscms/webcore/library/notice"
"github.com/coscms/webcore/library/respond"

uploadChunk "github.com/admpub/nging/v5/application/registry/upload/chunk"
uploadChunk "github.com/coscms/webcore/registry/upload/chunk"
uploadClient "github.com/webx-top/client/upload"
uploadDropzone "github.com/webx-top/client/upload/driver/dropzone"
)
Expand All @@ -51,7 +52,7 @@ func File(ctx echo.Context) error {
absPath = filepath.Join(root, filePath)
}

user := handler.User(ctx)
user := backend.User(ctx)
switch do {
case `edit`:
data := ctx.Data()
Expand Down Expand Up @@ -103,7 +104,7 @@ func File(ctx echo.Context) error {
absPath = filepath.Join(root, filePath)
err = mgr.Remove(absPath)
if err != nil {
handler.SendFail(ctx, err.Error())
common.SendFail(ctx, err.Error())
return ctx.Redirect(next)
}
}
Expand All @@ -117,7 +118,7 @@ func File(ctx echo.Context) error {
}
err = mgr.Upload(absPath, cu, opts...)
if err != nil {
user := handler.User(ctx)
user := backend.User(ctx)
if user != nil {
notice.OpenMessage(user.Username, `upload`)
notice.Send(user.Username, notice.NewMessageWithValue(`upload`, ctx.T(`文件上传出错`), err.Error()))
Expand All @@ -139,7 +140,7 @@ func File(ctx echo.Context) error {
pathSlice := strings.Split(strings.Trim(filePath, echo.FilePathSeparator), echo.FilePathSeparator)
pathLinks := make(echo.KVList, len(pathSlice))
encodedSep := filemanager.EncodedSepa
urlPrefix := handler.URLFor(`/download/file?path=` + encodedSep)
urlPrefix := backend.URLFor(`/download/file?path=` + encodedSep)
for k, v := range pathSlice {
urlPrefix += com.URLEncode(v)
pathLinks[k] = &echo.KV{K: v, V: urlPrefix}
Expand Down
4 changes: 2 additions & 2 deletions application/handler/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/webx-top/echo"
mw "github.com/webx-top/echo/middleware"

"github.com/admpub/nging/v5/application/library/config/startup"
"github.com/admpub/nging/v5/application/library/route"
"github.com/coscms/webcore/library/config/startup"
"github.com/coscms/webcore/library/route"
dlconfig "github.com/nging-plugins/dlmanager/application/library/config"
)

Expand Down
2 changes: 1 addition & 1 deletion application/handler/navigate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package handler

import "github.com/admpub/nging/v5/application/registry/navigate"
import "github.com/coscms/webcore/registry/navigate"

var LeftNavigate = &navigate.Item{
Display: true,
Expand Down
4 changes: 2 additions & 2 deletions application/library/config/config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package config

import (
"github.com/admpub/nging/v5/application/library/config"
"github.com/admpub/nging/v5/application/library/config/extend"
"github.com/coscms/webcore/library/config"
"github.com/coscms/webcore/library/config/extend"
)

func init() {
Expand Down
57 changes: 29 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module github.com/nging-plugins/dlmanager

go 1.22.0
go 1.23

replace github.com/admpub/nging/v5 => ../../admpub/nging
toolchain go1.23.0

require (
github.com/admpub/godownloader v2.2.0+incompatible
github.com/admpub/log v1.3.6
github.com/admpub/nging/v5 v5.3.1
github.com/webx-top/client v0.8.13
github.com/webx-top/com v1.2.13
github.com/webx-top/echo v1.7.8
github.com/coscms/webcore v0.0.0-20240911085259-de03337d48e1
github.com/webx-top/client v0.9.4
github.com/webx-top/com v1.3.1
github.com/webx-top/echo v1.9.0
)

require (
Expand All @@ -22,7 +22,7 @@ require (
github.com/admpub/color v1.8.1 // indirect
github.com/admpub/confl v0.2.4 // indirect
github.com/admpub/copier v0.1.1 // indirect
github.com/admpub/cron v0.0.1 // indirect
github.com/admpub/cron v0.1.1 // indirect
github.com/admpub/decimal v1.3.1 // indirect
github.com/admpub/email v2.4.1+incompatible // indirect
github.com/admpub/errors v0.8.2 // indirect
Expand All @@ -40,7 +40,6 @@ require (
github.com/admpub/godotenv v1.4.3 // indirect
github.com/admpub/gohls v1.3.3 // indirect
github.com/admpub/gohls-server v0.3.9 // indirect
github.com/admpub/gohttp v0.0.0-20190322032039-b55c707b8f1e // indirect
github.com/admpub/goth v0.0.4 // indirect
github.com/admpub/humanize v0.0.0-20190501023926-5f826e92c8ca // indirect
github.com/admpub/i18n v0.3.0 // indirect
Expand All @@ -59,9 +58,9 @@ require (
github.com/admpub/pester v0.0.0-20200411024648-005672a2bd48 // indirect
github.com/admpub/pp v0.0.7 // indirect
github.com/admpub/randomize v0.0.2 // indirect
github.com/admpub/realip v0.2.4 // indirect
github.com/admpub/redistore v1.2.1 // indirect
github.com/admpub/realip v0.2.7 // indirect
github.com/admpub/resty/v2 v2.7.1 // indirect
github.com/admpub/safesvg v0.0.8 // indirect
github.com/admpub/securecookie v1.3.0 // indirect
github.com/admpub/service v0.0.5 // indirect
github.com/admpub/sessions v0.2.1 // indirect
Expand All @@ -79,13 +78,12 @@ require (
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/friendsofgo/errors v0.9.2 // indirect
github.com/fynelabs/selfupdate v0.2.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
github.com/garyburd/redigo v1.6.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
github.com/go-errors/errors v1.5.1 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.22.0 // indirect
github.com/go-playground/validator/v10 v10.22.1 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
Expand All @@ -96,25 +94,28 @@ require (
github.com/grafov/m3u8 v0.12.0 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/h2non/filetype v1.1.3 // indirect
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lufia/plan9stats v0.0.0-20240513124658-fba389f38bae // indirect
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/microcosm-cc/bluemonday v1.0.26 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/muesli/smartcrop v0.3.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
github.com/onsi/gomega v1.34.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_golang v1.20.3 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.54.0 // indirect
github.com/prometheus/common v0.59.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd // indirect
Expand All @@ -131,23 +132,23 @@ require (
github.com/webx-top/captcha v0.1.0 // indirect
github.com/webx-top/chardet v0.0.2 // indirect
github.com/webx-top/codec v0.3.0 // indirect
github.com/webx-top/db v1.27.7 // indirect
github.com/webx-top/db v1.27.9 // indirect
github.com/webx-top/image v0.1.1 // indirect
github.com/webx-top/pagination v0.2.8 // indirect
github.com/webx-top/pagination v0.3.1 // indirect
github.com/webx-top/poolx v0.0.0-20210912044716-5cfa2d58e380 // indirect
github.com/webx-top/restyclient v0.0.4 // indirect
github.com/webx-top/tagfast v0.0.1 // indirect
github.com/webx-top/validation v0.0.3 // indirect
github.com/webx-top/validator v0.3.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/image v0.17.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/image v0.20.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 28cabfb

Please sign in to comment.