Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4bf060a + f7096a7 commit a037e55Copy full SHA for a037e55
apps/datas/paths.go
@@ -2,6 +2,7 @@ package datas
2
3
import (
4
"os"
5
+ "path"
6
"path/filepath"
7
"runtime"
8
"strings"
@@ -36,9 +37,14 @@ func GetDataDir(appName string) (string, error) {
36
37
}
38
39
// GetPath 根据系统类型, 返回对应保存数据的目录
-func GetPath(path string) string {
40
- dir, _ := GetDataDir("mysql-binlog-ui/" + path)
41
- return strings.ReplaceAll(dir, "//", "/")
+func GetPath(filePath string) string {
+ dir, _ := GetDataDir("mysql-binlog-ui/" + filePath)
42
+ dir = strings.ReplaceAll(dir, "//", "/")
43
+ savePath := path.Dir(dir)
44
+ if savePath == "." {
45
+ dir = strings.ReplaceAll(dir, "\\", "/")
46
+ }
47
+ return dir
48
49
50
// GetSqlitePath 根据系统类型, 返回对应保存数据的目录
0 commit comments