Skip to content

Commit

Permalink
Update: [Client] ログイン中にログイン画面・アカウント登録画面にアクセスした際に、自動的にアカウント設定画面に遷移させる
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Apr 25, 2023
1 parent 9d637f5 commit d14cde7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ export default Vue.extend({
// ref: https://pinia.vuejs.org/cookbook/options-api.html
...mapStores(useUserStore),
},
async created() {
// アカウント情報を更新
await this.userStore.fetchUser();
// 現在ログイン中の場合はアカウントページに遷移
if (this.userStore.is_logged_in) {
await this.$router.replace({path: '/settings/account'});
}
},
methods: {
async login() {
Expand Down
10 changes: 10 additions & 0 deletions client/src/views/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ export default Vue.extend({
// ref: https://pinia.vuejs.org/cookbook/options-api.html
...mapStores(useUserStore),
},
async created() {
// アカウント情報を更新
await this.userStore.fetchUser();
// 現在ログイン中の場合はアカウントページに遷移
if (this.userStore.is_logged_in) {
await this.$router.replace({path: '/settings/account'});
}
},
methods: {
async register() {
Expand Down

0 comments on commit d14cde7

Please sign in to comment.