跃然一笑
登录获取tokenthis.$http.get(Util.DataInterface + '/api/auth', { params: quseDataNow, emulateJSON: true }).then((response) => { localStorage.setItem('token', response.data.data.token); }, (response) => { console.log("error: ", response); });获取到token以后每次请求接口都带上headers: { Authorization: localStorage.getItem("token") },this.$http.get(Util.DataInterface + '/api/ranking/platform', { headers: { Authorization: localStorage.getItem("token") }, params: quesDataNow, emulateJSON: true }).then((response) => { this.tableList = response.data; $('#sortTable').DataTable().destroy(); this.tableLoad(); }, (response) => { // error callback if (response.status === 401) { Util.init(); } });