|
|
@@ -96,10 +96,10 @@ public class SimApiAuthGate(SimApiAuthGateClient simapi)
|
|
|
|
/// <param name="data"></param>
|
|
|
|
/// <param name="data"></param>
|
|
|
|
/// <param name="backUrl"></param>
|
|
|
|
/// <param name="backUrl"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public SimApiAuthGateDto.GetCodeResponse GetAuthCode(string? scene = null, Dictionary<string, object>? data = null,
|
|
|
|
public SimApiAuthGateDto.GetCodeResponse GetLoginCode(string? scene = null, Dictionary<string, object>? data = null,
|
|
|
|
string? backUrl = null)
|
|
|
|
string? backUrl = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var code = simapi.SignQuery<string>("/api/auth/confirm/code",
|
|
|
|
var code = simapi.SignQuery<string>("/api/auth/login/code",
|
|
|
|
new { scene, data, backUrl });
|
|
|
|
new { scene, data, backUrl });
|
|
|
|
return new SimApiAuthGateDto.GetCodeResponse()
|
|
|
|
return new SimApiAuthGateDto.GetCodeResponse()
|
|
|
|
{
|
|
|
|
{
|
|
|
@@ -115,9 +115,9 @@ public class SimApiAuthGate(SimApiAuthGateClient simapi)
|
|
|
|
/// <param name="code"></param>
|
|
|
|
/// <param name="code"></param>
|
|
|
|
/// <param name="scene"></param>
|
|
|
|
/// <param name="scene"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public SimApiAuthGateDto.AuthInfoResponse GetAuthInfo(string code, string? scene = null)
|
|
|
|
public SimApiAuthGateDto.LoginInfoResponse GetLoginInfo(string code, string? scene = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var resp = simapi.SignQuery<SimApiAuthGateDto.AuthInfoResponse>("/api/auth/confirm/get", new { code });
|
|
|
|
var resp = simapi.SignQuery<SimApiAuthGateDto.LoginInfoResponse>("/api/auth/login/get", new { code });
|
|
|
|
ErrorWhenNull(resp, 400232, "登录信息获取失败");
|
|
|
|
ErrorWhenNull(resp, 400232, "登录信息获取失败");
|
|
|
|
ErrorWhen(resp.Scene != scene, 403003, "登录场景不匹配");
|
|
|
|
ErrorWhen(resp.Scene != scene, 403003, "登录场景不匹配");
|
|
|
|
return resp;
|
|
|
|
return resp;
|
|
|
|