🔥 修改每日早报接口 Token 为手动配置

This commit is contained in:
李寻欢 2024-06-24 08:40:24 +08:00
parent de278f25e9
commit 0adc2ff628
3 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,7 @@
system: system:
# 每日新闻接口 Token
# 获取地址: https://admin.alapi.cn/api_manager/token_manager
alApiToken: xxx
# 添加新好友或群之后通知给指定的人 # 添加新好友或群之后通知给指定的人
newFriendNotify: newFriendNotify:
enable: true enable: true

View File

@ -2,6 +2,7 @@ package config
// 系统配置 // 系统配置
type system struct { type system struct {
AlApiToken string `json:"alApiToken" yaml:"alApiToken"` // AL API Token
NewFriendNotify newFriendNotify `json:"newFriendNotify" yaml:"newFriendNotify"` // 新好友通知 NewFriendNotify newFriendNotify `json:"newFriendNotify" yaml:"newFriendNotify"` // 新好友通知
DefaultRule defaultRule `json:"defaultRule" yaml:"defaultRule"` // 默认规则 DefaultRule defaultRule `json:"defaultRule" yaml:"defaultRule"` // 默认规则
} }

View File

@ -2,6 +2,7 @@ package utils
import ( import (
"github.com/go-resty/resty/v2" "github.com/go-resty/resty/v2"
"go-wechat/config"
"go-wechat/model" "go-wechat/model"
"log" "log"
) )
@ -33,7 +34,7 @@ func (news) MorningPost() (records []string) {
res := resty.New() res := resty.New()
resp, err := res.R(). resp, err := res.R().
SetHeader("Content-Type", "application/json;chartset=utf-8"). SetHeader("Content-Type", "application/json;chartset=utf-8").
SetQueryParam("token", "cFoMZNNBxT4jQovS"). SetQueryParam("token", config.Conf.System.AlApiToken).
SetResult(&newsResp). SetResult(&newsResp).
Post("https://v2.alapi.cn/api/zaobao") Post("https://v2.alapi.cn/api/zaobao")
if err != nil { if err != nil {