feat: integrate luckysheet inline and fullscreen
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// 封装用户请求axios
|
||||
import axios, { AxiosRequestConfig } from "axios";
|
||||
import { isDev } from "../utils";
|
||||
|
||||
export const fetch = (options: AxiosRequestConfig) => {
|
||||
return axios({
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
axios.defaults.baseURL = isDev() ? "/api" : "";
|
||||
|
||||
// 添加请求拦截器
|
||||
axios.interceptors.request.use(
|
||||
(config) => {
|
||||
// 在发送请求之前进行操作
|
||||
return config;
|
||||
},
|
||||
(error) => {
|
||||
// 对请求错误进行操作
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
// 添加响应拦截器
|
||||
axios.interceptors.response.use(
|
||||
function (res) {
|
||||
// 解构返回
|
||||
return res;
|
||||
},
|
||||
function (error) {
|
||||
// 对响应错误进行操作
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,19 @@
|
||||
import { fetch } from "./core";
|
||||
|
||||
// 导出初始化工作簿 API
|
||||
export const API_getWorkerBook = (gridKey: string) => {
|
||||
return fetch({
|
||||
url: "/getWorkerBook",
|
||||
method: "post",
|
||||
data: { gridKey },
|
||||
});
|
||||
};
|
||||
|
||||
// 导出图片上传API
|
||||
export const API_uploadImage = (data: FormData) => {
|
||||
return fetch({
|
||||
url: "/uploadImage",
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user