axios直接请求 不封装
axios直接请求不封装logout() {const token = window.sessionStorage.getItem("token");const token_type = window.sessionStorage.getItem("token_type");axios({method: "delete",url: "/" + process.env.VUE_APP_BASE_AP
·
axios直接请求 不封装
logout() {
const token = window.sessionStorage.getItem("token");
const token_type = window.sessionStorage.getItem("token_type");
axios({
method: "delete",
url: "/" + process.env.VUE_APP_BASE_API2 + "/oauth/logout",
headers: {
client_id: "dataexchange",
client_secret: "dataexchange",
deviceId: "web",
// token: token,
// Authorization: token_type + " " + token,
},
params: {
accessToken: token,
},
})
.then((res) => {
if (res && res.status == 200) {
sessionStorage.clear();
} else {
this.$message.error(res.message);
}
})
.catch((res) => {
});
},
axios({
method: "get",
url: "/" + process.env.VUE_APP_BASE_API2 + "/oauth/token",
params: {
username,
password,
loginType: 1,
kaptchaCode,
kaptchaKey: this.key,
},
headers: {
deviceId: "web",
Authorization: "Basic ZGF0Y",
},
})
.then((res) => {}).catch((res) => {
});
更多推荐
已为社区贡献4条内容
所有评论(0)