duxin 1 year ago
parent
commit
c3aa873cac
3 changed files with 8 additions and 1 deletions
  1. 2 1
      config.json
  2. 1 0
      config/config.go
  3. 5 0
      timedTask/timed.go

+ 2 - 1
config.json

@@ -91,6 +91,7 @@
  "everydayWordLimit": 2,
  "userMonthLimit": 1,
  "wordDuration": 3,
- "searchWordLimit": 50
+ "searchWordLimit": 50,
+ "sendMail": false
 }
 

+ 1 - 0
config/config.go

@@ -39,6 +39,7 @@ type config struct {
 	EverydayWordLimit int    `json:"everydayWordLimit"`
 	WordDuration      int    `json:"wordDuration"`
 	UserMail          string `json:"userMail"`
+	SendMail          bool   `json:"SendMail"`
 }
 
 var (

+ 5 - 0
timedTask/timed.go

@@ -68,6 +68,10 @@ func init() {
 	UserWord()
 	//每月搜索统计搜索词
 	SearchWordStatistics()
+	//初始化发送邮件
+	if Config.SendMail {
+		SendMail()
+	}
 }
 
 func timeFmt() (int64, int64) {
@@ -266,6 +270,7 @@ func keyFmt(aItems interface{}) {
 
 // 企业订阅
 func EntWord() {
+	entWordNumber = map[string]int{}
 	_, lt := IsOneDay()
 	tms := lt.AddDate(0, 0, -1)
 	//企业关键词查找