统一axios写法

This commit is contained in:
panlinlin
2021-04-12 16:04:04 +08:00
parent 27df8bd84c
commit 4010ed6c23
28 changed files with 243 additions and 218 deletions

View File

@@ -61,10 +61,11 @@ export default {
//设置在登录状态
this.isLoging = true;
this.$axios.get("/api/user/login",{
params: loginParam
} )
.then(function (res) {
this.$axios({
method: 'get',
url:"/api/user/login",
params: loginParam
}).then(function (res) {
console.log(JSON.stringify(res));
if (res.data == "success") {
that.$cookies.set("session", {"username": that.username}) ;
@@ -79,8 +80,7 @@ export default {
type: 'error'
});
}
})
.catch(function (error) {
}).catch(function (error) {
that.$message.error(error.response.statusText);
that.isLoging = false;
});