@@ -12,10 +12,10 @@ import (
1212 "github.com/PuerkitoBio/goquery"
1313)
1414
15- //自动跳转以刷新认证信息时,最大的递归调用次数
15+ // 自动跳转以刷新认证信息时,最大的递归调用次数
1616const MaxAuthRedirectCount = 5
1717
18- //登录
18+ // 登录
1919func (cli * Client ) login (email , password string ) error {
2020 vccodeInfo , err := cli .getVccode ()
2121 if err != nil {
@@ -44,7 +44,7 @@ type VCCodeInfo struct {
4444 Uid string
4545}
4646
47- //获取VCCode
47+ // 获取VCCode
4848func (cli * Client ) getVccode () (VCCodeInfo , error ) {
4949 resp , err := cli .Get (LoginUrl + "/login.do?opt=vccode" )
5050 if err != nil {
@@ -69,7 +69,7 @@ func (cli *Client) getVccode() (VCCodeInfo, error) {
6969 return respInfo , nil
7070}
7171
72- //鉴定用户
72+ // 鉴定用户
7373func (cli * Client ) verifyUser (vccodeInfo VCCodeInfo , email , password string ) error {
7474 //密码加密处理
7575 password = hexSha1 (password )
@@ -108,7 +108,7 @@ func (cli *Client) verifyUser(vccodeInfo VCCodeInfo, email, password string) err
108108 }
109109}
110110
111- //自动跟踪认证跳转,完成验证信息刷新
111+ // 自动跟踪认证跳转,完成验证信息刷新
112112func (cli * Client ) authRedirect (method , address string , data url.Values , jumpCount int ) error {
113113 if cli .Verbose {
114114 log .Println ("第" , jumpCount , "次认证跳转" , method , address , "参数" , data )
@@ -163,7 +163,7 @@ func (cli *Client) authRedirect(method, address string, data url.Values, jumpCou
163163 return cli .authRedirect (formMethod , formAction , formData , jumpCount + 1 )
164164}
165165
166- //密码加密,算法来自于: https://www.feidee.com/sso/js/fdLogin.js中的hex_sha1
166+ // 密码加密,算法来自于: https://www.feidee.com/sso/js/fdLogin.js中的hex_sha1
167167func hexSha1 (input string ) string {
168168 sha1Sum := sha1 .Sum ([]byte (input ))
169169 return hex .EncodeToString (sha1Sum [:])
0 commit comments