暂存
This commit is contained in:
40
src/module/query/get-router.ts
Normal file
40
src/module/query/get-router.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { useConfig } from '@abearxiong/use-config';
|
||||
|
||||
const { resources, api } = useConfig<{
|
||||
resources: string;
|
||||
api: { host: string };
|
||||
}>();
|
||||
|
||||
export const fetchTest = async (id: string) => {
|
||||
const fetchUrl = 'http://' + api.host + '/api/router';
|
||||
const fetchRes = await fetch(fetchUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
path: 'user-app',
|
||||
key: 'test',
|
||||
id: id,
|
||||
}),
|
||||
}).then((res) => res.json());
|
||||
return fetchRes;
|
||||
};
|
||||
|
||||
export const fetchDomain = async (domain: string) => {
|
||||
const fetchUrl = 'http://' + api.host + '/api/router';
|
||||
const fetchRes = await fetch(fetchUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
path: 'app',
|
||||
key: 'getDomainApp',
|
||||
data: {
|
||||
domain,
|
||||
},
|
||||
}),
|
||||
}).then((res) => res.json());
|
||||
return fetchRes;
|
||||
};
|
||||
Reference in New Issue
Block a user