8
0
gaore-common-sdk-go/services/web/force_out.go
huangqz 252e5953f3 feat(www,web): 新增 RefreshUserSessionID 与 web.ForceOut
重置密码副作用配套:
- services/www 新增 RefreshUserSessionID(清 www 登录态,apisdk.gaore.com /user/sdk_passport.php)及无凭证 NewClient
- 新建 services/web 包,ForceOut 清官网 web 登录态(web.gaore.com /web/users/force_out)
端点/参数/签名与老综合后台 GaoreSDK 1:1 对齐
2026-06-17 10:05:05 +08:00

45 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package web
import (
"fmt"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
)
// forceOutSignKey 老综合后台业务层计算 sign 用的固定盐
const forceOutSignKey = "user_session_20220505"
type ForceOutReq struct {
*requests.RpcRequest
}
type ForceOutResp struct {
*responses.BaseResponse
}
// CreateForceOutReq 创建官网强制下线请求
// POST web.gaore.com/web/users/force_outsign=md5(user_name+time+"user_session_20220505")
func CreateForceOutReq(userName string, ts int64) *ForceOutReq {
sign := utils.Md5(fmt.Sprintf("%s%d%s", userName, ts, forceOutSignKey))
req := &ForceOutReq{
RpcRequest: &requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/web/users/force_out")
req.FormParams = map[string]string{
"user_name": userName,
"time": fmt.Sprintf("%d", ts),
"sign": sign,
}
req.Method = requests.POST
return req
}
func CreateForceOutResp() *ForceOutResp {
return &ForceOutResp{
BaseResponse: &responses.BaseResponse{},
}
}