fix & update

This commit is contained in:
骑着蜗牛追导弹 2023-01-16 14:05:06 +08:00
parent 94bb29f2d3
commit baeb818760
10 changed files with 8 additions and 16 deletions

View File

@ -48,14 +48,10 @@ CuteGo是一套全部开源的快速开发平台毫无保留给个人及企
# 后执行
$env:GOPROXY = "https://goproxy.io,direct"
```
- 3、将docs下的configs目录移动到cutego目录下
![Configs](docs/images/ConfigFile.png)
- 4、idea配置如下
- 3、idea配置如下
![Edit Configurations...](docs/images/RunConfig.png)
- 5、下载依赖 go mod tidy
- 4、下载依赖 go mod tidy
![Download Mod](docs/images/DownloadMod.png)
#### 使用说明

View File

@ -39,8 +39,8 @@ func (s LoginInfoService) GetRequestClientIp(c *gin.Context) string {
return reqIP
}
// 纯真数据库获取ip地址
// @return {"Ip": "180.89.94.90","Country": "北京市","City": "鹏博士宽带"}
// GetLocationByIp 纯真数据库获取ip地址
// @return {"Ip": "IP地址","Country": "国家","City": "城市"}
func (s LoginInfoService) GetLocationByIp(ipAddr string) *qqwry.QQwry {
address := net.ParseIP(ipAddr)
if ipAddr == "" || address == nil {

BIN
docs/idea_config.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

5
go.mod
View File

@ -6,18 +6,17 @@ require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/druidcaesa/gotool v0.0.0-20210722000450-b972ac6f3771
github.com/gin-gonic/gin v1.7.3
github.com/go-basic/uuid v1.0.0 // indirect
github.com/go-basic/uuid v1.0.0
github.com/go-sql-driver/mysql v1.6.0
github.com/go-xorm/xorm v0.7.9
github.com/gomodule/redigo v1.8.5
github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 // indirect
github.com/gorilla/websocket v1.5.0
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
github.com/lestrrat-go/strftime v1.0.5 // indirect
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5
github.com/robfig/cron v1.2.0 // indirect
github.com/robfig/cron v1.2.0
github.com/sirupsen/logrus v1.8.1
github.com/xuri/excelize/v2 v2.4.1
github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc // indirect

2
go.sum
View File

@ -73,8 +73,6 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY=
github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=

View File

@ -53,11 +53,10 @@ func LoadYamlFile(filename string, v interface{}) {
}
}
// 配置文件所在路径
const BaseConfigDirPath = "configs"
// BaseConfigDirPath 配置文件所在路径
const BaseConfigDirPath = "resources"
func readAppYmlFile(resourcePath string) {
// 读取主配置文件
applicationCoreFileName := BaseConfigDirPath + "/application.yml"
applicationCoreFilePath := resourcePath + GetPathSeparator() + applicationCoreFileName