feat: add delete cookies functionality for login reset (#275)

This commit is contained in:
Ctrlz
2025-11-02 19:01:48 +08:00
committed by GitHub
parent 7cf35fc4ae
commit 11a937b84f
6 changed files with 88 additions and 11 deletions

View File

@@ -86,6 +86,13 @@ type UserProfileResponse struct {
Feeds []xiaohongshu.Feed `json:"feeds"`
}
// DeleteCookies 删除 cookies 文件,用于登录重置
func (s *XiaohongshuService) DeleteCookies(ctx context.Context) error {
cookiePath := cookies.GetCookiesFilePath()
cookieLoader := cookies.NewLoadCookie(cookiePath)
return cookieLoader.DeleteCookies()
}
// CheckLoginStatus 检查登录状态
func (s *XiaohongshuService) CheckLoginStatus(ctx context.Context) (*LoginStatusResponse, error) {
b := newBrowser()