浏览代码

修改发送邮件、修复时间问题

5 年之前
父节点
当前提交
a0f258740e
共有 3 个文件被更改,包括 6 次插入6 次删除
  1. 3 3
      api_test/config.json
  2. 1 1
      api_test/main.go
  3. 2 2
      jyservice/src/usermanager/sendmail.go

+ 3 - 3
api_test/config.json

@@ -1,6 +1,6 @@
 {
-    "appid": "jyPz5XQgMABgVeTkdOMTBx",
-    "key": "349300qe",
+    "appid": "jyOh1XQgUJBQ5bTUlKCyZ1",
+    "key": "56IrWR74",
     "day": "-1",
-    "apiurl": "https://testapi2.jianyu360.com"
+    "apiurl": "https://api.jianyu360.com"
 }

+ 1 - 1
api_test/main.go

@@ -53,7 +53,7 @@ func getData() {
 	data := post(apiurl+"/data/getalldata", map[string]string{
 		"access_token": token,
 		"day":          day,
-		"next":         "0",
+		"next":         "92",
 	})
 	//s, _ := json.Marshal(data["data"])
 	//delete(data, "data")

+ 2 - 2
jyservice/src/usermanager/sendmail.go

@@ -215,8 +215,8 @@ func sendmail(appid string, days int, force int, fn string, bcron bool, startTim
 						st1, _ = strconv.ParseInt(startTime, 10, 64)
 						st, _ = strconv.ParseInt(endTime, 10, 64)
 					} else if reg2.MatchString(startTime) {
-						d1, _ := time.Parse(qu.Date_Short_Layout, startTime)
-						d2, _ := time.Parse(qu.Date_Short_Layout, endTime)
+						d1, _ := time.ParseInLocation(qu.Date_Short_Layout, startTime, time.Local)
+						d2, _ := time.ParseInLocation(qu.Date_Short_Layout, endTime, time.Local)
 						st1 = d1.Unix()
 						st = d2.Unix()
 					} else {