feat(csms): 添加 OCPP 鉴权
This commit is contained in:
@@ -160,6 +160,18 @@ export type UserRow = {
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
export type ChargePointCreated = ChargePoint & {
|
||||
/** 仅在创建时返回一次的明文密码,之后不可再查 */
|
||||
plainPassword: string;
|
||||
};
|
||||
|
||||
export type ChargePointPasswordReset = {
|
||||
id: string;
|
||||
chargePointIdentifier: string;
|
||||
/** 仅在重置时返回一次的新明文密码 */
|
||||
plainPassword: string;
|
||||
};
|
||||
|
||||
export type PaginatedTransactions = {
|
||||
data: Transaction[];
|
||||
total: number;
|
||||
@@ -221,7 +233,7 @@ export const api = {
|
||||
pricingMode?: "fixed" | "tou";
|
||||
deviceName?: string;
|
||||
}) =>
|
||||
apiFetch<ChargePoint>("/api/charge-points", {
|
||||
apiFetch<ChargePointCreated>("/api/charge-points", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
}),
|
||||
@@ -242,6 +254,10 @@ export const api = {
|
||||
}),
|
||||
delete: (id: string) =>
|
||||
apiFetch<{ success: true }>(`/api/charge-points/${id}`, { method: "DELETE" }),
|
||||
resetPassword: (id: string) =>
|
||||
apiFetch<ChargePointPasswordReset>(`/api/charge-points/${id}/reset-password`, {
|
||||
method: "POST",
|
||||
}),
|
||||
},
|
||||
transactions: {
|
||||
list: (params?: {
|
||||
|
||||
Reference in New Issue
Block a user