fix #301 should push to "/files"
This commit is contained in:
@@ -35,7 +35,6 @@ export default defineStore('loginStore', {
|
||||
const response = await axios.post(api, this.auth, config);
|
||||
const accessToken = response.data.access_token;
|
||||
const refreshToken = response.data.refresh_token;
|
||||
|
||||
// 將 token 儲存在 cookie
|
||||
document.cookie = `luciaToken=${accessToken}`;
|
||||
// document.cookie = `luciaRefreshToken=${refreshToken};expires=${new Date(this.expired)};`;
|
||||
@@ -48,7 +47,7 @@ export default defineStore('loginStore', {
|
||||
if(this.rememberedReturnToUrl !== "") {
|
||||
window.location.href = atob(this.rememberedReturnToUrl);
|
||||
} else {
|
||||
this.$router.push('/login');
|
||||
this.$router.push('/files');
|
||||
}
|
||||
} catch(error) {
|
||||
this.isInvalid = true;
|
||||
|
||||
@@ -106,7 +106,9 @@ export default {
|
||||
created() {
|
||||
// 考慮到使用者可能在未登入的情況下貼入一個頁面網址連結過來瀏覽器
|
||||
// btoa: 對字串進行 Base64 編碼
|
||||
if(this.$route.query['return-to']) {
|
||||
this.setRememberedReturnToUrl(btoa(this.$route.query['return-to']));
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user