mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
add switch
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { computed, ref } from 'vue'
|
||||
import { AddressInfo, BiliAuthModel, ResponsePointGoodModel } from '@/api/api-models'
|
||||
import { BiliAuthModel, ResponsePointGoodModel } from '@/api/api-models'
|
||||
import { QueryGetAPI, QueryPostAPI } from '@/api/query'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { BILI_AUTH_API_URL, POINT_API_URL } from '@/data/constants'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { MessageApiInjection } from 'naive-ui/es/message/src/MessageProvider'
|
||||
import { defineStore } from 'pinia'
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
export const useAuthStore = defineStore('BiliAuth', () => {
|
||||
const biliAuth = ref<BiliAuthModel>({} as BiliAuthModel)
|
||||
|
||||
@@ -38,7 +38,7 @@ export const useQuestionBox = defineStore('QuestionBox', () => {
|
||||
const displayQuestion = ref<QAInfo>()
|
||||
|
||||
let isRevieveGetted = false
|
||||
let isSendGetted = false
|
||||
//const isSendGetted = false
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
@@ -83,7 +83,7 @@ export const useQuestionBox = defineStore('QuestionBox', () => {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('发生错误')
|
||||
message.error('发生错误: ' + err)
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
@@ -97,7 +97,7 @@ export const useQuestionBox = defineStore('QuestionBox', () => {
|
||||
})
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
var index = recieveQuestions.value.findIndex((q) => q.id == id)
|
||||
const index = recieveQuestions.value.findIndex((q) => q.id == id)
|
||||
if (index > -1) {
|
||||
recieveQuestions.value[index] = data.data
|
||||
}
|
||||
@@ -109,7 +109,7 @@ export const useQuestionBox = defineStore('QuestionBox', () => {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('发送失败')
|
||||
message.error('发送失败: ' + err)
|
||||
})
|
||||
.finally(() => {
|
||||
isRepling.value = false
|
||||
@@ -131,7 +131,7 @@ export const useQuestionBox = defineStore('QuestionBox', () => {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('修改失败')
|
||||
message.error('修改失败: ' + err)
|
||||
})
|
||||
}
|
||||
async function favorite(question: QAInfo, fav: boolean) {
|
||||
@@ -147,7 +147,7 @@ export const useQuestionBox = defineStore('QuestionBox', () => {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('修改失败')
|
||||
message.error('修改失败: ' + err)
|
||||
})
|
||||
}
|
||||
async function setPublic(pub: boolean) {
|
||||
@@ -165,7 +165,7 @@ export const useQuestionBox = defineStore('QuestionBox', () => {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('修改失败')
|
||||
message.error('修改失败: ' + err)
|
||||
})
|
||||
.finally(() => {
|
||||
isChangingPublic.value = false
|
||||
@@ -191,7 +191,7 @@ export const useQuestionBox = defineStore('QuestionBox', () => {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('拉黑失败')
|
||||
message.error('拉黑失败: ' + err)
|
||||
})
|
||||
}
|
||||
async function setCurrentQuestion(item: QAInfo) {
|
||||
|
||||
Reference in New Issue
Block a user