【发布时间】:2021-07-26 23:41:01
【问题描述】:
我想在回调中登录后手动导航到主页。
methods: {
async userLogin() {
var session_url = "/api/v1/authenticate";
axios
.post(session_url, this.login, {})
.then(function (response) {
console.log("Authenticated", response.data.access_token);
window.localStorage.setItem("token", response.data.access_token);
// Manually trigger route here.
})
.catch(function (error) {
console.log("Error on Authentication", error);
});
},
},
【问题讨论】: