|
@@ -6,10 +6,22 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+import { getInfo } from '@/api/login'
|
|
import ReRecord from './components/ReRecord.vue'
|
|
import ReRecord from './components/ReRecord.vue'
|
|
import Login from './components/Login.vue'
|
|
import Login from './components/Login.vue'
|
|
import useUserStore from "@/store/user";
|
|
import useUserStore from "@/store/user";
|
|
|
|
+import { onMounted } from 'vue';
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ getInfo().then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ userStore.setLogin(true);
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ userStore.setLogin(false);
|
|
|
|
+ });
|
|
|
|
+});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|
|
<style lang="scss" scoped></style>
|