更新路径拼接

This commit is contained in:
ayflying
2025-05-14 16:17:00 +08:00
parent a62c359fd7
commit 595ababfde

View File

@@ -88,8 +88,8 @@ func (c *Cfg) GetFile(filename string, _pathStr ...string) (jsonObj *gjson.Json,
//如果还是没有读取到配置,从当前目录返回上级读取 //如果还是没有读取到配置,从当前目录返回上级读取
if bytes == nil { if bytes == nil {
// 拼接完整的文件路径 // 上级拼接完整的文件路径
filePath = "../../" + pathStr + filename + ".json" filePath = "../../" + filePath
if gfile.IsFile(filePath) { if gfile.IsFile(filePath) {
bytes = gfile.GetBytes(filePath) // 读取物理文件内容 bytes = gfile.GetBytes(filePath) // 读取物理文件内容
} }