新增: 壁纸切换(主题/本地图片/Bing/纯色渐变)
This commit is contained in:
@@ -70,7 +70,7 @@ func getLocation() City {
|
||||
if city := locateByIPIP(); city != nil {
|
||||
return *city
|
||||
}
|
||||
if city := locateByQWeather(); city != nil {
|
||||
if city := locateByGeoAPI(); city != nil {
|
||||
return *city
|
||||
}
|
||||
log.Println("所有定位失败,使用默认城市:", defaultCity.Name)
|
||||
@@ -104,7 +104,7 @@ func locateByIPIP() *City {
|
||||
return nil
|
||||
}
|
||||
|
||||
func locateByQWeather() *City {
|
||||
func locateByGeoAPI() *City {
|
||||
data, err := httpGet("https://myip.ipip.net")
|
||||
if err == nil {
|
||||
re := regexp.MustCompile(`(\d+\.\d+\.\d+\.\d+)`)
|
||||
|
||||
Reference in New Issue
Block a user