let _this = this; axios.post("http://localhost:8081/indexpage").then(function (resp) { _this.contentList = resp.data }); //判断登陆状态 首先获取名为"Linusername"的会话存储数据 if (this.checkLogin()){ this.login = true this.login_username = sessionStorage.getItem("Linusername") } console.log(this.input)
let _this = this; axios.get("http://localhost:8081/searchbook",{ params: { input: _this.input, page: (_this.currentPage-1)*10 // page 传入偏移量 } }).then(function (resp) { if(resp.data.name === '无'){ alert('暂无该种图书') } else { _this.bookList = resp.data; console.log(_this.bookList); axios.get("http://localhost:8081/searchbookpage",{ params: { input: _this.input } }).then(function (resp) { _this.totalpage = resp.data.totalpage; }); } });