代码拉取完成,页面将自动刷新
package authing_v2
import (
"fmt"
"net/http"
jsoniter "github.com/json-iterator/go"
)
func (a *AuthingCli) PostAccountLogin(appId, tenantId string, payload interface{}) (interface{}, error) {
url := "/api/v2/login/account"
b, err := SendHttpRestRequest_fix(a.Cli, a.Cli.Host, url, http.MethodPost, payload, appId, tenantId, a.UserPoolId)
if err != nil {
return false, err
}
var resp map[string]interface{}
e := jsoniter.Unmarshal(b, &resp)
return &resp, e
}
func (a *AuthingCli) PostPhoneCodeLogin(appId, tenantId string, payload interface{}) (interface{}, error) {
url := "/api/v2/login/phone-code"
b, err := SendHttpRestRequest_fix(a.Cli, a.Cli.Host, url, http.MethodPost, payload, appId, tenantId, a.UserPoolId)
if err != nil {
return false, err
}
var resp map[string]interface{}
e := jsoniter.Unmarshal(b, &resp)
return &resp, e
}
func (a *AuthingCli) PostEmailCodeLogin(appId, tenantId string, payload interface{}) (interface{}, error) {
url := "/api/v2/login/email-code"
b, err := SendHttpRestRequest_fix(a.Cli, a.Cli.Host, url, http.MethodPost, payload, appId, tenantId, a.UserPoolId)
if err != nil {
return false, err
}
var resp map[string]interface{}
e := jsoniter.Unmarshal(b, &resp)
return &resp, e
}
func (a *AuthingCli) GetLoginStatus(appId, tenantId string, payload interface{}) (interface{}, error) {
url := "/api/v2/users/login/check-status"
b, err := SendHttpRestRequest_fix(a.Cli, a.Cli.Host, url, http.MethodPost, payload, appId, tenantId, a.UserPoolId)
if err != nil {
return false, err
}
var resp map[string]interface{}
e := jsoniter.Unmarshal(b, &resp)
return &resp, e
}
func (a *AuthingCli) GetMeInfo(appId, tenantId, authorization string) (interface{}, error) {
url := fmt.Sprintf("%s/api/v2/users/me", a.Cli.Host)
b, err := SendHttpRestRequest_with_auth(url, http.MethodGet, appId, tenantId, a.UserPoolId, authorization)
if err != nil {
return false, err
}
var resp map[string]interface{}
e := jsoniter.Unmarshal(b, &resp)
return &resp, e
}
func (a *AuthingCli) FindUserWhenLogin(appId, tenantId, key, loginType string) (interface{}, error) {
url := fmt.Sprintf("/api/v2/users/find?userPoolId=%s&key=%s&type=%s", a.UserPoolId, key, loginType)
b, err := SendHttpRestRequest_fix(a.Cli, a.Cli.Host, url, http.MethodGet, nil, appId, tenantId, a.UserPoolId)
if err != nil {
return false, err
}
var resp map[string]interface{}
e := jsoniter.Unmarshal(b, &resp)
return &resp, e
}
func (a *AuthingCli) SendEmailWhenLogin(appId, tenantId string, payload interface{}) (interface{}, error) {
url := "/api/v2/email/send"
b, err := SendHttpRestRequest_fix(a.Cli, a.Cli.Host, url, http.MethodPost, payload, appId, tenantId, a.UserPoolId)
if err != nil {
return false, err
}
var resp map[string]interface{}
e := jsoniter.Unmarshal(b, &resp)
return &resp, e
}
func (a *AuthingCli) SendSmsWhenLogin(appId, tenantId string, payload interface{}) (interface{}, error) {
url := "/api/v2/sms/send"
b, err := SendHttpRestRequest_fix(a.Cli, a.Cli.Host, url, http.MethodPost, payload, appId, tenantId, a.UserPoolId)
if err != nil {
return false, err
}
var resp map[string]interface{}
e := jsoniter.Unmarshal(b, &resp)
return &resp, e
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。