auth

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package auth 定义登录认证接口的声明。

auth 接口不走 Execute(需要 Set-Cookie 创建 session),只含 Meta + MapRequest。 auth service 直接调 engine.RawDoWithCookie,拿到 raw + setCookie 后调 model 解码 + Save session。

Index

Constants

This section is empty.

Variables

View Source
var (
	// SendCaptcha 发送验证码。
	SendCaptcha = engine.Meta{
		Path: "/weapi/sms/captcha/sent", Method: "POST", Crypto: engine.CryptoWeAPI, Auth: session.AuthAnonymous,
	}
	// LoginByCellphone 手机号登录。
	LoginCellphone = engine.Meta{
		Path: "/weapi/login/cellphone", Method: "POST", Crypto: engine.CryptoWeAPI, Auth: session.AuthAnonymous,
	}
	// LoginQrcode 获取二维码 key(weapi,参考 chaunsin/netease-cloud-music CLI 验证过)。
	LoginQrcode = engine.Meta{
		Path: "/weapi/login/qrcode/unikey", Method: "POST", Crypto: engine.CryptoWeAPI, Auth: session.AuthAnonymous,
	}
	// CheckQrcode 轮询二维码状态(weapi)。
	CheckQrcode = engine.Meta{
		Path: "/weapi/login/qrcode/client/login", Method: "POST", Crypto: engine.CryptoWeAPI, Auth: session.AuthAnonymous,
	}
	// LoginStatus 查询登录态。
	LoginStatus = engine.Meta{
		Path: "/weapi/w/nuser/account/get", Method: "POST", Crypto: engine.CryptoWeAPI, Auth: session.AuthAnonymous,
	}
	// Logout 登出。
	Logout = engine.Meta{
		Path: "/weapi/logout", Method: "POST", Crypto: engine.CryptoWeAPI, Auth: session.AuthAnonymous,
	}
)

Functions

func CheckQrcodeRequest

func CheckQrcodeRequest(req *mmpb.CheckQrcodeRequest) map[string]any

CheckQrcodeRequest 构造轮询二维码入参。

func LoginCellphoneRequest

func LoginCellphoneRequest(req *mmpb.LoginByCellphoneRequest) map[string]any

LoginCellphoneRequest 构造手机登录入参。

func LoginQrcodeRequest

func LoginQrcodeRequest(_ *mmpb.LoginQrcodeRequest) map[string]any

LoginQrcodeRequest 构造获取二维码 key 入参。 type=1 是 weapi 二维码登录的值(参考 chaunsin Go 版 CLI 验证)。

func LoginStatusRequest

func LoginStatusRequest(_ *mmpb.LoginStatusRequest) map[string]any

LoginStatusRequest 构造查询登录态入参。

func LogoutRequest

func LogoutRequest(_ *mmpb.LogoutRequest) map[string]any

LogoutRequest 构造登出入参。

func QrcodeURL

func QrcodeURL(key string) string

QrcodeURL 从 key 构造二维码扫描 URL。

func SendCaptchaRequest

func SendCaptchaRequest(req *mmpb.SendCaptchaRequest) map[string]any

SendCaptchaRequest 构造发送验证码入参。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL