The axios interface encapsulated by vue, the request interface dynamically adds headers&responseType

1. When encountering a requirement and disconnecting the interface, add a parameter to the headers.

// 调试日志下载
export const getDebug  = (params) => {
	const uploadaxios = axios.create({
		headers:{
			'Range':'bytes=0-'
		},
		responseType: 'blob'
	})
	return uploadaxios.get(`/device_maintenance/file_get`, {params} ).then(res => res.data);
	
};
// 可以加一个参数吧headers传进来

Insert image description here

Guess you like

Origin blog.csdn.net/weixin_53587375/article/details/129727863