mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-08 01:00:36 +08:00
fix bugs
This commit is contained in:
@@ -8,7 +8,7 @@ import AnalyticsTotalProfitLineCharts from '@/views/dashboard/AnalyticsTotalProf
|
||||
import AnalyticsTransactions from '@/views/dashboard/AnalyticsTransactions.vue'
|
||||
import AnalyticsUserTable from '@/views/dashboard/AnalyticsUserTable.vue'
|
||||
import AnalyticsWeeklyOverview from '@/views/dashboard/AnalyticsWeeklyOverview.vue'
|
||||
import CardStatisticsVertical from '@core/components/cards/CardStatisticsVertical.vue'
|
||||
import CardStatisticsVertical from '@components/cards/CardStatisticsVertical.vue'
|
||||
|
||||
const totalProfit = {
|
||||
title: 'Total Profit',
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import api from '@/api';
|
||||
import router from '@/router';
|
||||
import logo from '@images/logo.svg?raw';
|
||||
import { useStore } from 'vuex';
|
||||
import { useStore } from 'vuex'
|
||||
import api from '@/api'
|
||||
import router from '@/router'
|
||||
import logo from '@images/logo.svg?raw'
|
||||
|
||||
// Vuex Store
|
||||
const store = useStore();
|
||||
const store = useStore()
|
||||
|
||||
// 表单
|
||||
const form = ref({
|
||||
@@ -59,11 +59,11 @@ const login = () => {
|
||||
})
|
||||
.then((response: any) => {
|
||||
// 获取token
|
||||
const token = response.access_token;
|
||||
const token = response.access_token
|
||||
|
||||
// 更新token和remember状态到Vuex Store
|
||||
store.dispatch('auth/updateToken', token);
|
||||
store.dispatch('auth/updateRemember', form.value.remember);
|
||||
store.dispatch('auth/updateToken', token)
|
||||
store.dispatch('auth/updateRemember', form.value.remember)
|
||||
|
||||
// 跳转到首页
|
||||
router.push('/')
|
||||
@@ -90,8 +90,8 @@ const login = () => {
|
||||
// 自动登录
|
||||
onMounted(() => {
|
||||
// 从Vuex Store中获取token和remember状态
|
||||
const token = store.state.auth.token;
|
||||
const remember = store.state.auth.remember;
|
||||
const token = store.state.auth.token
|
||||
const remember = store.state.auth.remember
|
||||
|
||||
// 如果token存在,且保持登录状态为true,则跳转到首页
|
||||
if (token && remember) {
|
||||
|
||||
Reference in New Issue
Block a user