var ttt = [
					{column: "username", type: "EQ", values: "ts"},
				]
						
				var test = {
					pageNum: 1,
					pageSize: 30,
					params: JSON.stringify(ttt)
				}
				
				// $.ajax({ 
				// 	type: "GET",
				// 	url: "http://localhost:8099/api/sysUser",
				// 	beforeSend: function(xhr) { 
				// 		xhr.setRequestHeader("X-Token", "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiYXVkIjoibWlkZG9sIiwiaXNzIjoidXNlcl9jZW50ZXIiLCJleHAiOjE2MTI1MTUwOTYsInVzZXJJZCI6MSwiaWF0IjoxNjEyNTExNDk2fQ.T-AtWBNU5OnGViFOD2LGoCSoQNo3kwxYXb2JFBL8peU");  
				// 	},
				// 	contentType: "application/json;charset=utf-8",
				// 	data: test,
				// 	dataType: "json",
				// 	success: function(response, status, request){
				// 		console.log("111111111111111111")
				// 		console.log(response);
				// 		console.log(status);
				// 		console.log(request.getAllResponseHeaders());
				// 	}
				// });
				
				axios.defaults.baseURL = 'http://localhost:8099/api';
				axios.defaults.headers.common['X-Token'] = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiYXVkIjoibWlkZG9sIiwiaXNzIjoidXNlcl9jZW50ZXIiLCJleHAiOjE2MTI1MTg4MzYsInVzZXJJZCI6MSwiaWF0IjoxNjEyNTE1MjM2fQ.2PI5F9Ad-dTUBnQqxjidEybhJik9T1Czs6VCWHyZ9dU";
				axios.defaults.headers.post['Content-Type'] = 'application/json;charset=utf-8';
				
				axios.get("/sysUser", {
					params: test,
					paramsSerializer: function(params) {
						return Qs.stringify(params, {arrayFormat: 'repeat'})
					}
				})
				.then(function(response){
					console.log(response)
				}).catch(function(error){
					console.log("报错啦")
					console.log(error)
				})

效果:

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐