协议数据模拟测试
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { ApiClient } from "../client/ApiClient";
|
||||
import type { Endpoint } from "../client/endpoints";
|
||||
import type { ApiResponse } from "../client/types";
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
import type { IAuthService } from "./IAuthService";
|
||||
|
||||
export class HttpAuthService implements IAuthService {
|
||||
constructor(private api = ApiClient.I) {}
|
||||
|
||||
// 登录
|
||||
async login(req: proto.cs.ICSLoginReq): Promise<ApiResponse<proto.cs.ICSLoginRes>> {
|
||||
const ep: Endpoint<proto.cs.ICSLoginReq, proto.cs.ICSLoginRes> = {
|
||||
path: "api/acc/login",
|
||||
method: "POST",
|
||||
codec: "json",
|
||||
needsAuth: false,
|
||||
};
|
||||
return this.api.call(ep, req);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user