feat: license setting

This commit is contained in:
Tristan Yang
2022-07-11 20:24:00 +08:00
parent 45a147ae67
commit cb80f87033
5 changed files with 164 additions and 2 deletions
+20 -2
View File
@@ -13,7 +13,8 @@ import {
CreateAdminDTO,
SMTPConfig,
AgoraConfig,
GithubAuthConfig
GithubAuthConfig,
LicenseResponse
} from "../../types/server";
const defaultExpireDuration = 7 * 24 * 60 * 60;
@@ -192,6 +193,21 @@ export const serverApi = createApi({
query: () => ({
url: `/admin/system/initialized`
})
}),
checkLicense: builder.mutation<LicenseResponse, string>({
query: (license) => ({
url: "/license/check",
method: "POST",
body: { license }
})
}),
upsertLicense: builder.mutation<boolean, string>({
query: (license) => ({
url: "/license/save",
method: "POST",
body: { license }
})
})
})
});
@@ -223,5 +239,7 @@ export const {
useGetThirdPartySecretQuery,
useUpdateThirdPartySecretMutation,
useCreateAdminMutation,
useGetInitializedQuery
useGetInitializedQuery,
useUpsertLicenseMutation,
useCheckLicenseMutation
} = serverApi;