ログインとサインアップのシステムをnuxtで作成しました。システムはデータベースのデータを取得し、誰かがログに記録されているかどうかを確認するために '条件付きであればログに記録されたページにリダイレクトするコードがありますが、これは私が思ったようにうまく機能しませんでした。Nuxt、Axios、Feathersのサインインログインシステム
<script>
import Logo from '~components/Logo.vue'
import axios from 'axios'
export default {
components: {
Logo
},
data() {
return { test: [] }
},
mounted() {
axios.get('http://localhost:3030/users').then((res) => { this.test =
res.data.data })
for (let y of this.test) { if (y.loged) { location.href =
'http://localhost:3000/home' } }
}
}
</script>