feat: frontend url setting
This commit is contained in:
@@ -94,9 +94,10 @@ export const channelApi = createApi({
|
||||
transformResponse: (link: string) => {
|
||||
// 确保http开头
|
||||
const _link = link.startsWith("http") ? link : `http://${link}`;
|
||||
return _link;
|
||||
// 替换掉域名
|
||||
const invite = new URL(_link);
|
||||
return `${location.origin}${invite.pathname}${invite.search}${invite.hash}`;
|
||||
// const invite = new URL(_link);
|
||||
// return `${location.origin}${invite.pathname}${invite.search}${invite.hash}`;
|
||||
}
|
||||
}),
|
||||
removeChannel: builder.query<void, number>({
|
||||
|
||||
@@ -195,6 +195,12 @@ export const serverApi = createApi({
|
||||
body: data
|
||||
})
|
||||
}),
|
||||
updateFrontendUrl: builder.mutation<void, string>({
|
||||
query: (url) => ({
|
||||
url: `/admin/system/update_frontend_url?frontend_url=${encodeURIComponent(url)}`,
|
||||
method: "POST",
|
||||
})
|
||||
}),
|
||||
getLicense: builder.query<LicenseResponse, void>({
|
||||
query: () => ({
|
||||
url: `/license`
|
||||
@@ -285,5 +291,6 @@ export const {
|
||||
useGetLicensePaymentUrlMutation,
|
||||
useLazyGetGeneratedLicenseQuery,
|
||||
useLazyGetBotRelatedChannelsQuery,
|
||||
useSendMessageByBotMutation
|
||||
useSendMessageByBotMutation,
|
||||
useUpdateFrontendUrlMutation
|
||||
} = serverApi;
|
||||
|
||||
Reference in New Issue
Block a user