feat: 替换认证存储逻辑为BiliAuth

- 将所有使用useAuthStore的地方替换为useBiliAuth
- 删除useAuthStore文件,整合认证逻辑
- 更新相关视图和组件以适应新的认证存储
This commit is contained in:
2025-05-02 01:59:21 +08:00
parent c922f8358a
commit 993107c24c
18 changed files with 477 additions and 218 deletions

View File

@@ -11,7 +11,7 @@ import {
import AddressDisplay from '@/components/manage/AddressDisplay.vue'
import PointGoodsItem from '@/components/manage/PointGoodsItem.vue'
import { POINT_API_URL } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore'
import { useBiliAuth } from '@/store/useBiliAuth'
import {
NAlert,
NButton,
@@ -43,7 +43,7 @@ const props = defineProps<{
}>()
const router = useRouter()
const useAuth = useAuthStore()
const useAuth = useBiliAuth()
// 移除未使用的 accountInfo
const isLoading = ref(false)
const message = useMessage()

View File

@@ -2,12 +2,12 @@
import { ResponsePointOrder2UserModel } from '@/api/api-models'
import PointOrderCard from '@/components/manage/PointOrderCard.vue'
import { POINT_API_URL } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore'
import { useBiliAuth } from '@/store/useBiliAuth'
import { NButton, NEmpty, NFlex, NSpin, useMessage } from 'naive-ui'
import { onMounted, ref } from 'vue'
const message = useMessage()
const useAuth = useAuthStore()
const useAuth = useBiliAuth()
const orders = ref<ResponsePointOrder2UserModel[]>([])
const isLoading = ref(false)

View File

@@ -2,12 +2,12 @@
import { ResponsePointHisrotyModel } from '@/api/api-models'
import PointHistoryCard from '@/components/manage/PointHistoryCard.vue'
import { POINT_API_URL } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore'
import { useBiliAuth } from '@/store/useBiliAuth'
import { NButton, NEmpty, NFlex, NSpin, useMessage } from 'naive-ui'
import { onMounted, ref } from 'vue'
const message = useMessage()
const useAuth = useAuthStore()
const useAuth = useBiliAuth()
const isLoading = ref(false)
const history = ref<ResponsePointHisrotyModel[]>([])

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { UserInfo } from '@/api/api-models'
import { POINT_API_URL } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore'
import { useBiliAuth } from '@/store/useBiliAuth'
import { useRouteHash } from '@vueuse/router'
import {
NAlert,
@@ -48,7 +48,7 @@ interface SettingsViewInstance extends ComponentWithReset {
// 设置组件可能需要的方法
}
const useAuth = useAuthStore()
const useAuth = useBiliAuth()
const message = useMessage()
const realHash = useRouteHash('points', {
mode: 'replace',

View File

@@ -2,7 +2,7 @@
import { AddressInfo } from '@/api/api-models'
import AddressDisplay from '@/components/manage/AddressDisplay.vue'
import { CURRENT_HOST, POINT_API_URL, THINGS_URL } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore'
import { useBiliAuth } from '@/store/useBiliAuth'
import { useStorage } from '@vueuse/core'
import {
FormRules,
@@ -41,7 +41,7 @@ type AreaData = {
}
}
const useAuth = useAuthStore()
const useAuth = useBiliAuth()
const message = useMessage()
const isLoading = ref(false)
const userAgree = ref(false)