Baidu-Login: github.com/Erope/Baidu-Login Index | Files | Directories

package baidulogin

import "github.com/Erope/Baidu-Login"

Index

Package Files

config.go http_request.go http_server.go http_server_page.go util.go version.go

Constants

const (
    // Version 版本号
    Version = "v1.2.1"
)

func StartServer Uses

func StartServer(port string)

StartServer 启动 http 服务

type BaiduClient Uses

type BaiduClient struct {
    *requester.HTTPClient
    // contains filtered or unexported fields
}

BaiduClient 记录登录百度所使用的信息

func NewBaiduClinet Uses

func NewBaiduClinet() *BaiduClient

NewBaiduClinet 返回 BaiduClient 指针对象

func (*BaiduClient) BaiduLogin Uses

func (bc *BaiduClient) BaiduLogin(username, password, verifycode, vcodestr string) (lj *LoginJSON)

BaiduLogin 发送 百度登录请求

func (*BaiduClient) SendCodeToUser Uses

func (bc *BaiduClient) SendCodeToUser(verifyType, token string) (msg string)

SendCodeToUser 发送验证码到 手机/邮箱

func (*BaiduClient) VerifyCode Uses

func (bc *BaiduClient) VerifyCode(verifyType, token, vcode, u string) (lj *LoginJSON)

VerifyCode 输入 手机/邮箱 收到的验证码, 验证登录

type LoginJSON Uses

type LoginJSON struct {
    ErrInfo struct {
        No  string `json:"no"`
        Msg string `json:"msg"`
    }   `json:"errInfo"`
    Data struct {
        CodeString   string `json:"codeString"`
        GotoURL      string `json:"gotoUrl"`
        Token        string `json:"token"`
        U            string `json:"u"`
        AuthSID      string `json:"authsid"`
        Phone        string `json:"phone"`
        Email        string `json:"email"`
        BDUSS        string `json:"bduss"`
        PToken       string `json:"ptoken"`
        SToken       string `json:"stoken"`
        CookieString string `json:"cookieString"`
    }   `json:"data"`
}

LoginJSON 从百度服务器解析的数据结构

Directories

PathSynopsis
bdcrypto
bdcrypto/ecb

Package baidulogin imports 18 packages (graph) and is imported by 2 packages. Updated 2020-09-18. Refresh now. Tools for package owners.