可以打包
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 126 KiB |
@@ -0,0 +1,72 @@
|
||||
import axios from 'axios';
|
||||
import qs from 'qs';
|
||||
|
||||
const apiClient = axios.create({
|
||||
baseURL: 'http://localhost:18090', // Replace with your API base URL
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
});
|
||||
|
||||
export const postData = async (data) => {
|
||||
try {
|
||||
const response = await apiClient.post('/do', qs.stringify(data));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Error posting data:', error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export const getVersion = async () => {
|
||||
const data = {
|
||||
};
|
||||
try {
|
||||
const response = await apiClient.post('/', qs.stringify(data));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Error posting data:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const getList = async () => {
|
||||
const data = {
|
||||
order: '01000005'
|
||||
};
|
||||
return postData(data);
|
||||
}
|
||||
|
||||
|
||||
export const addFakeUkey = async (name) => {
|
||||
const data = {
|
||||
name
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await apiClient.post('/fakeUkey/add', qs.stringify(data));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Error posting data:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const delFakeUkey = async (name) => {
|
||||
const data = {
|
||||
name
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await apiClient.post('/fakeUkey/del', qs.stringify(data));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Error posting data:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
console.log(structuredClone)
|
||||
Reference in New Issue
Block a user