refactor: 对齐 simapi-net 的 20 项差异
- SimApiLoginItem._types 默认 [user] - 新增 SimApiIdOnlyRequest - errorWhenNone 改名 errorWhenNull - SimApiAuth.update 保留 TTL(Redis ttl/expire) - SimApiCache: set 接受 Any + 新增 get<T>/getString - SimApiHttpClient 签名字段移出 Options - SimApiUtil: md5/sha1 支持 mode + 新增 paginate - @SimApiAuth 支持逗号分隔多类型 - Logger: 4 位毫秒 + IsEnabled 恒 true - 删除 /versions 端点;exceptionHandler 改为抛错 - UseSimApi 中间件顺序对齐 .NET - README 同步更新
This commit is contained in:
@@ -193,6 +193,8 @@ public class SimApiAuthCenter {
|
||||
public func getLoginInfo(code: String, scene!: ?String = None): LoginInfoResponse {
|
||||
var body = HashMap<String, Any>()
|
||||
body["code"] = code
|
||||
// 说明:C# 的 ErrorWhenNull(resp, 400232, "登录信息获取失败") 对应 signQuery 内部 _data.getOrThrow() 的
|
||||
// None 分支;仓颉版 signQuery 返回非空 T(data 缺失即抛异常),故此处无需重复判空。
|
||||
let resp = _client.signQuery<LoginInfoResponse>("/api/auth/login/get", body: SimApiJson.json(Some(body)))
|
||||
SimApiError.errorWhen(resp._scene != scene, code: 403003, message: "登录场景不匹配")
|
||||
resp
|
||||
|
||||
Reference in New Issue
Block a user