优化
This commit is contained in:
@@ -29,9 +29,7 @@ if (process.env.NODE_ENV === 'development') {
|
||||
|
||||
// 请求拦截器
|
||||
axios.interceptors.request.use((config) => {
|
||||
console.log("config", config)
|
||||
const url = sliceUrl(config.url)
|
||||
console.log("url", url)
|
||||
// if (!(config.url == 'templateList' || config.url == 'languageList')) {
|
||||
// config.headers['vvtoken'] = getToken();
|
||||
// }
|
||||
@@ -48,9 +46,7 @@ axios.interceptors.request.use((config) => {
|
||||
|
||||
// 响应拦截器
|
||||
axios.interceptors.response.use((response) => {
|
||||
console.log("```````````````response```````````````````", response.data)
|
||||
if (response.data.code == '200') {
|
||||
console.log("response", response.data.data)
|
||||
return response.data.data
|
||||
} else {
|
||||
router.push('/')
|
||||
@@ -83,9 +79,6 @@ export function getAxios({ url, params }) {
|
||||
// axios的post请求
|
||||
export function postAxios({ url, data }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log("```````````````data```````````````", data);
|
||||
console.log("````````````````url````````````````", url);
|
||||
|
||||
axios.post(
|
||||
url,
|
||||
data,
|
||||
@@ -104,8 +97,6 @@ export const downFile = async (urlstr, data) => {
|
||||
// 获取文件名(如果后端设置了 Content-Disposition)
|
||||
const contentDisposition = response.headers['content-disposition'];
|
||||
let fileName = 'default-file-name'; // 默认文件名
|
||||
console.log(contentDisposition)
|
||||
console.log(response)
|
||||
if (contentDisposition) {
|
||||
// 从响应头中提取文件名
|
||||
const fileNameMatch = contentDisposition.match(/filename="(.+)"/);
|
||||
@@ -139,7 +130,6 @@ function cheekalive() {
|
||||
}
|
||||
}
|
||||
).then(res => {
|
||||
console.log(res.data)
|
||||
if (res.data) {
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user