getInfo(){
var that = this
let obj = {
banner: axios.get(that.url + "home.php?Action=banner&setaction=banner"),
logo: axios.get(that.url + "home.php?Action=advertising&setaction=logo"),
code: axios.get(that.url + "home.php?Action=advertising&setaction=code"),
himg: axios.get(that.url + "home.php?Action=advertising&setaction=himg"),
link: axios.get(that.url + "home.php?Action=infolist&QType=link"),
qq: axios.get(that.url + "home.php?Action=infocontent&setaction=qq"),
mail: axios.get(that.url + "home.php?Action=infocontent&setaction=mail"),
phone: axios.get(that.url + "home.php?Action=infocontent&setaction=phone"),
Hotline: axios.get(that.url + "home.php?Action=infocontent&setaction=Hotline")
}
return obj
}
var that = this
axios.all([that.getInfo().banner, that.getInfo().logo, that.getInfo().code,
that.getInfo().himg, that.getInfo().link, that.getInfo().qq, that.getInfo().mail,
that.getInfo().phone, that.getInfo().Hotline
])
.then(axios.spread(function(banner,logo,code,himg,link,qq,mail,phone,Hotline){
that.banner = banner.data
var swiper1 = new Swiper(".banners", {
pagination: {
el: ".swiper-pagination",
},
autoplay: true,
speed: 800,
observer:true,
});
that.logo = logo.data.photo
that.code = code.data.photo
that.htxtimg = himg.data.photo
that.link = link.data
that.qq = qq.data.Content
console.log(qq);
that.mail = mail.data.Content
that.phone = phone.data.Content
that.Hotline = Hotline.data.Content
}))
as shown in the figure, how many axios.all () there are, there will be fewer requests, not only once at the same time.
are there any solutions for each god, or open one by one?