add cn host

This commit is contained in:
2025-03-18 23:33:49 +08:00
parent 31f765277a
commit b8b73ba6f2
6 changed files with 102 additions and 32 deletions

View File

@@ -36,6 +36,7 @@ export const BASE_HUB_URL =
export const TURNSTILE_KEY = '0x4AAAAAAAETUSAKbds019h0' export const TURNSTILE_KEY = '0x4AAAAAAAETUSAKbds019h0'
export const CURRENT_HOST = `${window.location.protocol}//${window.location.host}/` export const CURRENT_HOST = `${window.location.protocol}//${window.location.host}/`
export const CN_HOST = 'https://cn.vtsuru.suki.club/'
export const USER_API_URL = BASE_API_URL + 'user/' export const USER_API_URL = BASE_API_URL + 'user/'
export const ACCOUNT_API_URL = BASE_API_URL + 'account/' export const ACCOUNT_API_URL = BASE_API_URL + 'account/'

View File

@@ -3,7 +3,7 @@ import { useAccount } from '@/api/account'
import { BiliAuthCodeStatusType, BiliAuthModel } from '@/api/api-models' import { BiliAuthCodeStatusType, BiliAuthModel } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query' import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue' import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
import { ACCOUNT_API_URL, TURNSTILE_KEY } from '@/data/constants' import { ACCOUNT_API_URL, CN_HOST, TURNSTILE_KEY } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore' import { useAuthStore } from '@/store/useAuthStore'
import { Info24Filled, Mic24Filled, Question24Regular } from '@vicons/fluent' import { Info24Filled, Mic24Filled, Question24Regular } from '@vicons/fluent'
import { useLocalStorage } from '@vueuse/core' import { useLocalStorage } from '@vueuse/core'
@@ -286,8 +286,13 @@ onUnmounted(() => {
</script> </script>
<template> <template>
<NFlex justify="center" align="center" vertical> <NAlert type="success" style="width: 100%; ">
<NTabs type="segment" animated v-if="accountInfo" style="width: 100%;" :default-value="$route.query.tab?.toString() ?? 'info'"> 本站新增国内镜像: {{ CN_HOST }}, 访问更快
</NAlert>
<NDivider />
<NFlex justify="center" align="center" vertical style="margin: 0 auto; max-width: 1500px;">
<NTabs type="segment" animated v-if="accountInfo" style="width: 100%;"
:default-value="$route.query.tab?.toString() ?? 'info'">
<NTabPane name="info" tab="个人信息" style="width: 100%;" display-directive="show:lazy"> <NTabPane name="info" tab="个人信息" style="width: 100%;" display-directive="show:lazy">
<NFlex justify="center" align="center"> <NFlex justify="center" align="center">
<NCard embedded style="width: 100%;max-width: 800px;"> <NCard embedded style="width: 100%;max-width: 800px;">

View File

@@ -2,7 +2,7 @@
import { copyToClipboard, downloadImage } from '@/Utils' import { copyToClipboard, downloadImage } from '@/Utils'
import { DisableFunction, EnableFunction, SaveSetting, useAccount } from '@/api/account' import { DisableFunction, EnableFunction, SaveSetting, useAccount } from '@/api/account'
import { FunctionTypes, QAInfo, Setting_QuestionDisplay } from '@/api/api-models' import { FunctionTypes, QAInfo, Setting_QuestionDisplay } from '@/api/api-models'
import { CURRENT_HOST } from '@/data/constants' import { CN_HOST, CURRENT_HOST } from '@/data/constants'
import router from '@/router' import router from '@/router'
import { Heart, HeartOutline, TrashBin } from '@vicons/ionicons5' import { Heart, HeartOutline, TrashBin } from '@vicons/ionicons5'
import QuestionItem from '@/components/QuestionItem.vue' import QuestionItem from '@/components/QuestionItem.vue'
@@ -62,6 +62,8 @@ const shareModalVisiable = ref(false)
const replyMessage = ref() const replyMessage = ref()
const addTagName = ref('') const addTagName = ref('')
const useCNUrl = useStorage('Settings.UseCNUrl', false)
const showSettingCard = ref(true) const showSettingCard = ref(true)
const showOBSModal = ref(false) const showOBSModal = ref(false)
const defaultSettings = {} as Setting_QuestionDisplay const defaultSettings = {} as Setting_QuestionDisplay
@@ -81,6 +83,7 @@ const setting = computed({
const shareCardRef = ref() const shareCardRef = ref()
const shareUrl = computed(() => `${CURRENT_HOST}@` + accountInfo.value?.name + '/question-box') const shareUrl = computed(() => `${CURRENT_HOST}@` + accountInfo.value?.name + '/question-box')
const shareUrlCN = computed(() => CN_HOST + accountInfo.value?.name + '/question-box')
const ps = ref(20) const ps = ref(20)
const pn = ref(1) const pn = ref(1)
@@ -239,6 +242,17 @@ onMounted(() => {
</NTooltip> </NTooltip>
</NAlert> </NAlert>
</NSpace> </NSpace>
<NDivider style="margin: 16px 0 16px 0" title-placement="left">
提问页链接
</NDivider>
<NFlex align="center">
<NInputGroup style="max-width: 400px;">
<NInput :value="`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/question-box`" readonly />
<NButton secondary @click="copyToClipboard(`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/question-box`)">
复制 </NButton>
</NInputGroup>
<NCheckbox v-model:checked="useCNUrl"> 使用国内镜像(访问更快) </NCheckbox>
</NFlex>
<NDivider style="margin: 10px 0 10px 0" /> <NDivider style="margin: 10px 0 10px 0" />
<template v-if="useQB.reviewing > 0"> <template v-if="useQB.reviewing > 0">
<NAlert type="warning" title="有提问正在审核中"> <NAlert type="warning" title="有提问正在审核中">
@@ -506,9 +520,14 @@ onMounted(() => {
</div> </div>
<NDivider style="margin: 10px" /> <NDivider style="margin: 10px" />
<NInputGroup> <NInputGroup>
<NInput :value="shareUrl" /> <NInput :value="shareUrl" readonly/>
<NButton secondary @click="copyToClipboard(shareUrl)"> 复制 </NButton> <NButton secondary @click="copyToClipboard(shareUrl)"> 复制 </NButton>
</NInputGroup> </NInputGroup>
<NDivider style="margin: 10px"> 国内镜像 (访问更快) </NDivider>
<NInputGroup>
<NInput :value="shareUrlCN" readonly />
<NButton secondary @click="copyToClipboard(shareUrlCN)"> 复制 </NButton>
</NInputGroup>
<br /><br /> <br /><br />
<NSpace justify="center"> <NSpace justify="center">
<NButton type="primary" @click="saveShareImage"> 保存卡片 </NButton> <NButton type="primary" @click="saveShareImage"> 保存卡片 </NButton>

View File

@@ -3,14 +3,18 @@ import { DisableFunction, EnableFunction, useAccount } from '@/api/account'
import { FunctionTypes, ScheduleWeekInfo } from '@/api/api-models' import { FunctionTypes, ScheduleWeekInfo } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query' import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import ScheduleList from '@/components/ScheduleList.vue' import ScheduleList from '@/components/ScheduleList.vue'
import { SCHEDULE_API_URL } from '@/data/constants' import { CN_HOST, CURRENT_HOST, SCHEDULE_API_URL } from '@/data/constants'
import { copyToClipboard } from '@/Utils'
import { useStorage } from '@vueuse/core'
import { addWeeks, endOfWeek, endOfYear, format, isBefore, startOfWeek, startOfYear } from 'date-fns' import { addWeeks, endOfWeek, endOfYear, format, isBefore, startOfWeek, startOfYear } from 'date-fns'
import { import {
NAlert, NAlert,
NBadge, NBadge,
NButton, NButton,
NCheckbox,
NColorPicker, NColorPicker,
NDivider, NDivider,
NFlex,
NInput, NInput,
NInputGroup, NInputGroup,
NInputGroupLabel, NInputGroupLabel,
@@ -130,6 +134,8 @@ const showCopyModal = ref(false)
const updateScheduleModel = ref<ScheduleWeekInfo>({} as ScheduleWeekInfo) const updateScheduleModel = ref<ScheduleWeekInfo>({} as ScheduleWeekInfo)
const selectedExistTag = ref() const selectedExistTag = ref()
const useCNUrl = useStorage('Settings.UseCNUrl', false)
const selectedDay = ref(0) const selectedDay = ref(0)
const selectedScheduleYear = ref(new Date().getFullYear()) const selectedScheduleYear = ref(new Date().getFullYear())
const selectedScheduleWeek = ref(Number(format(Date.now(), 'w')) + 1) const selectedScheduleWeek = ref(Number(format(Date.now(), 'w')) + 1)
@@ -277,7 +283,17 @@ onMounted(() => {
<NButton @click="$router.push({ name: 'manage-index', query: { tab: 'template', template: 'schedule' } })"> <NButton @click="$router.push({ name: 'manage-index', query: { tab: 'template', template: 'schedule' } })">
修改模板 修改模板
</NButton> </NButton>
</NSpace> </NSpace><NDivider style="margin: 16px 0 16px 0" title-placement="left">
日程表展示页链接
</NDivider>
<NFlex align="center">
<NInputGroup style="max-width: 400px;">
<NInput :value="`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/schedule`" readonly />
<NButton secondary @click="copyToClipboard(`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/schedule`)">
复制 </NButton>
</NInputGroup>
<NCheckbox v-model:checked="useCNUrl"> 使用国内镜像(访问更快) </NCheckbox>
</NFlex>
<NDivider /> <NDivider />
<NModal v-model:show="showAddModal" style="width: 600px; max-width: 90vw" preset="card" title="添加周程"> <NModal v-model:show="showAddModal" style="width: 600px; max-width: 90vw" preset="card" title="添加周程">
<NSpace vertical> <NSpace vertical>

View File

@@ -1,12 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { objectsToCSV } from '@/Utils' import { copyToClipboard, objectsToCSV } from '@/Utils'
import { DisableFunction, EnableFunction, useAccount } from '@/api/account' import { DisableFunction, EnableFunction, useAccount } from '@/api/account'
import { FunctionTypes, SongFrom, SongLanguage, SongRequestOption, SongsInfo } from '@/api/api-models' import { FunctionTypes, SongFrom, SongLanguage, SongRequestOption, SongsInfo } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query' import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import SongList from '@/components/SongList.vue' import SongList from '@/components/SongList.vue'
import { FETCH_API, SONG_API_URL } from '@/data/constants' import { CN_HOST, CURRENT_HOST, FETCH_API, SONG_API_URL } from '@/data/constants'
import { Info24Filled } from '@vicons/fluent' import { Info24Filled } from '@vicons/fluent'
import { ArchiveOutline } from '@vicons/ionicons5' import { ArchiveOutline } from '@vicons/ionicons5'
import { useStorage } from '@vueuse/core'
import { format } from 'date-fns' import { format } from 'date-fns'
// @ts-ignore // @ts-ignore
import { saveAs } from 'file-saver' import { saveAs } from 'file-saver'
@@ -58,6 +59,8 @@ const neteaseIdInput = ref()
const fivesingSearchInput = ref() const fivesingSearchInput = ref()
const isModalLoading = ref(false) const isModalLoading = ref(false)
const useCNUrl = useStorage('Settings.UseCNUrl', false)
const onlyResetNameOnAdded = ref(true) const onlyResetNameOnAdded = ref(true)
const neteaseSongListId = computed(() => { const neteaseSongListId = computed(() => {
@@ -600,15 +603,15 @@ onMounted(async () => {
</NAlert> </NAlert>
<NButton @click="showModal = true" type="primary"> 添加歌曲 </NButton> <NButton @click="showModal = true" type="primary"> 添加歌曲 </NButton>
<NButton @click="exportData" type="primary" secondary> 导出为 CSV </NButton> <NButton @click="exportData" type="primary" secondary> 导出为 CSV </NButton>
<NButton @click="$router.push({ name: 'manage-liveRequest' })" secondary> 前往点 </NButton> <NButton @click="$router.push({ name: 'manage-liveRequest' })" secondary> 前往点播管理 </NButton>
<NButton @click="$router.push({ name: 'user-songList', params: { id: accountInfo?.name } })" secondary> <NButton @click="$router.push({ name: 'user-songList', params: { id: accountInfo?.name } })" secondary>
前往展示页 前往歌单展示页
</NButton> </NButton>
<NButton :loading="isLoading" @click="() => { <NButton :loading="isLoading" @click="() => {
getSongs() getSongs()
message.success('完成') message.success('完成')
} }
"> ">
刷新 刷新
</NButton> </NButton>
<NButton <NButton
@@ -616,6 +619,17 @@ onMounted(async () => {
修改模板 修改模板
</NButton> </NButton>
</NSpace> </NSpace>
<NDivider style="margin: 16px 0 16px 0" title-placement="left">
歌单展示页链接
</NDivider>
<NFlex align="center">
<NInputGroup style="max-width: 400px;">
<NInput :value="`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/song-list`" readonly />
<NButton secondary @click="copyToClipboard(`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/song-list`)">
复制 </NButton>
</NInputGroup>
<NCheckbox v-model:checked="useCNUrl"> 使用国内镜像(访问更快) </NCheckbox>
</NFlex>
<NDivider style="margin: 16px 0 16px 0" /> <NDivider style="margin: 16px 0 16px 0" />
<NModal v-model:show="showModal" style="max-width: 1000px" preset="card" :key="showModalRenderKey"> <NModal v-model:show="showModal" style="max-width: 1000px" preset="card" :key="showModalRenderKey">
<template #header> 添加歌曲 </template> <template #header> 添加歌曲 </template>
@@ -659,15 +673,15 @@ onMounted(async () => {
</template> </template>
<NSpace vertical> <NSpace vertical>
<NCheckbox :checked="addSongModel.options != undefined" @update:checked="(checked: boolean) => { <NCheckbox :checked="addSongModel.options != undefined" @update:checked="(checked: boolean) => {
addSongModel.options = checked addSongModel.options = checked
? ({ ? ({
needJianzhang: false, needJianzhang: false,
needTidu: false, needTidu: false,
needZongdu: false, needZongdu: false,
} as SongRequestOption) } as SongRequestOption)
: undefined : undefined
} }
"> ">
是否启用 是否启用
</NCheckbox> </NCheckbox>
<template v-if="addSongModel.options != undefined"> <template v-if="addSongModel.options != undefined">
@@ -678,9 +692,9 @@ onMounted(async () => {
</NSpace> </NSpace>
<NSpace align="center"> <NSpace align="center">
<NCheckbox :checked="addSongModel.options.scMinPrice != undefined" @update:checked="(checked: boolean) => { <NCheckbox :checked="addSongModel.options.scMinPrice != undefined" @update:checked="(checked: boolean) => {
if (addSongModel.options) addSongModel.options.scMinPrice = checked ? 30 : undefined if (addSongModel.options) addSongModel.options.scMinPrice = checked ? 30 : undefined
} }
"> ">
需要SC 需要SC
</NCheckbox> </NCheckbox>
<NInputGroup v-if="addSongModel.options?.scMinPrice" style="width: 200px"> <NInputGroup v-if="addSongModel.options?.scMinPrice" style="width: 200px">
@@ -690,9 +704,9 @@ onMounted(async () => {
</NSpace> </NSpace>
<NSpace align="center"> <NSpace align="center">
<NCheckbox :checked="addSongModel.options.fanMedalMinLevel != undefined" @update:checked="(checked: boolean) => { <NCheckbox :checked="addSongModel.options.fanMedalMinLevel != undefined" @update:checked="(checked: boolean) => {
if (addSongModel.options) addSongModel.options.fanMedalMinLevel = checked ? 5 : undefined if (addSongModel.options) addSongModel.options.fanMedalMinLevel = checked ? 5 : undefined
} }
"> ">
需要粉丝牌 需要粉丝牌
<NTooltip> <NTooltip>
<template #trigger> <template #trigger>

View File

@@ -1,11 +1,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { getImageUploadModel } from '@/Utils' import { copyToClipboard, getImageUploadModel } from '@/Utils'
import { DisableFunction, EnableFunction, useAccount } from '@/api/account' import { DisableFunction, EnableFunction, useAccount } from '@/api/account'
import { FunctionTypes, GoodsStatus, GoodsTypes, PointGoodsModel, ResponsePointGoodModel } from '@/api/api-models' import { FunctionTypes, GoodsStatus, GoodsTypes, PointGoodsModel, ResponsePointGoodModel } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query' import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue' import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
import PointGoodsItem from '@/components/manage/PointGoodsItem.vue' import PointGoodsItem from '@/components/manage/PointGoodsItem.vue'
import { FILE_BASE_URL, POINT_API_URL } from '@/data/constants' import { CN_HOST, CURRENT_HOST, FILE_BASE_URL, POINT_API_URL } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore' import { useAuthStore } from '@/store/useAuthStore'
import { Info24Filled } from '@vicons/fluent' import { Info24Filled } from '@vicons/fluent'
import { useRouteHash } from '@vueuse/router' import { useRouteHash } from '@vueuse/router'
@@ -25,6 +25,7 @@ import {
NImage, NImage,
NInput, NInput,
NInputNumber, NInputNumber,
NInputGroup,
NModal, NModal,
NPopconfirm, NPopconfirm,
NRadioButton, NRadioButton,
@@ -45,6 +46,7 @@ import { computed, onMounted, ref } from 'vue'
import PointOrderManage from './PointOrderManage.vue' import PointOrderManage from './PointOrderManage.vue'
import PointSettings from './PointSettings.vue' import PointSettings from './PointSettings.vue'
import PointUserManage from './PointUserManage.vue' import PointUserManage from './PointUserManage.vue'
import { useStorage } from '@vueuse/core'
const message = useMessage() const message = useMessage()
const accountInfo = useAccount() const accountInfo = useAccount()
@@ -83,6 +85,8 @@ const showAddGoodsModal = ref(false)
const isAllowedPrivacyPolicy = ref(false) const isAllowedPrivacyPolicy = ref(false)
const isUpdating = ref(false) const isUpdating = ref(false)
const useCNUrl = useStorage('Settings.UseCNUrl', false)
const allowedYearOptions = computed(() => { const allowedYearOptions = computed(() => {
//从2024到现在的年份 //从2024到现在的年份
return Array.from({ length: new Date().getFullYear() - 2024 + 1 }, (_, i) => 2024 + i).map((item) => { return Array.from({ length: new Date().getFullYear() - 2024 + 1 }, (_, i) => 2024 + i).map((item) => {
@@ -377,6 +381,17 @@ onMounted(() => { })
</NAlert> </NAlert>
<EventFetcherStatusCard /> <EventFetcherStatusCard />
</NFlex> </NFlex>
<NDivider style="margin: 16px 0 16px 0" title-placement="left">
礼物展示页链接
</NDivider>
<NFlex align="center">
<NInputGroup style="max-width: 400px;">
<NInput :value="`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/point`" readonly />
<NButton secondary @click="copyToClipboard(`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/point`)">
复制 </NButton>
</NInputGroup>
<NCheckbox v-model:checked="useCNUrl"> 使用国内镜像(访问更快) </NCheckbox>
</NFlex>
<NDivider /> <NDivider />
<NTabs animated v-model:value="hash"> <NTabs animated v-model:value="hash">
<NTabPane name="goods" tab="礼物"> <NTabPane name="goods" tab="礼物">