update ver

This commit is contained in:
Megghy
2023-12-22 11:45:29 +08:00
parent caa3c390a2
commit cb23bb7fc6
10 changed files with 5608 additions and 3429 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
.DS_Store .DS_Store
node_modules node_modules
/dist /dist
.yarn
# local env files # local env files

3
.yarnrc.yml Normal file
View File

@@ -0,0 +1,3 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.0.2.cjs

View File

@@ -3,23 +3,22 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"prebuild": "node gen-version.js",
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"lint": "vite lint" "lint": "vite lint"
}, },
"dependencies": { "dependencies": {
"@types/node": "^20.10.5", "@types/node": "^20.10.5",
"@typescript-eslint/eslint-plugin": "^6.14.0", "@typescript-eslint/eslint-plugin": "^6.15.0",
"@vicons/fluent": "^0.12.0", "@vicons/fluent": "^0.12.0",
"@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue": "^4.5.2",
"@vueuse/core": "^10.1.2", "@vueuse/core": "^10.7.0",
"@vueuse/router": "^10.1.2", "@vueuse/router": "^10.7.0",
"date-fns": "^2.30.0", "date-fns": "^3.0.5",
"easy-speech": "^2.2.0", "easy-speech": "^2.2.0",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"eslint-plugin-import": "^2.29.1", "eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.0.1", "eslint-plugin-prettier": "^5.1.1",
"fast-xml-parser": "^4.3.2", "fast-xml-parser": "^4.3.2",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"grapheme-splitter": "^1.0.4", "grapheme-splitter": "^1.0.4",
@@ -31,27 +30,28 @@
"queue-typescript": "^1.0.1", "queue-typescript": "^1.0.1",
"vite": "^5.0.10", "vite": "^5.0.10",
"vite-svg-loader": "^5.1.0", "vite-svg-loader": "^5.1.0",
"vue": "^3.3.12", "vue": "^3.3.13",
"vue-echarts": "^6.6.5", "vue-echarts": "^6.6.5",
"vue-request": "^2.0.3", "vue-request": "^2.0.4",
"vue-router": "4", "vue-router": "^4.2.5",
"vue-turnstile": "^1.0.6", "vue-turnstile": "^1.0.6",
"vue3-aplayer": "^1.7.3", "vue3-aplayer": "^1.7.3",
"vue3-marquee": "^4.1.0", "vue3-marquee": "^4.1.0",
"vueuc": "^0.4.51", "vueuc": "^0.4.56",
"worker-timers": "^7.0.78" "worker-timers": "^7.0.80"
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.21.3", "@babel/eslint-parser": "^7.23.3",
"@typescript-eslint/parser": "^6.14.0", "@typescript-eslint/parser": "^6.15.0",
"@vicons/ionicons5": "^0.12.0", "@vicons/ionicons5": "^0.12.0",
"@vitejs/plugin-vue-jsx": "^3.1.0", "@vitejs/plugin-vue-jsx": "^3.1.0",
"@vue/eslint-config-typescript": "^12.0.0", "@vue/eslint-config-typescript": "^12.0.0",
"eslint": "^8.39.0", "eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-vue": "^9.11.0", "eslint-plugin-vue": "^9.19.2",
"naive-ui": "^2.34.3", "naive-ui": "^2.36.0",
"stylus": "^0.62.0", "stylus": "^0.62.0",
"typescript": "~5.3.3" "typescript": "^5.3.3"
} },
"packageManager": "yarn@4.0.2"
} }

View File

@@ -93,7 +93,7 @@ export function GetString(account: AccountInfo | undefined, live: ResponseLiveIn
}) })
} }
}) })
function GetTime(danmaku: DanmakuModel) { const GetTime = (danmaku: DanmakuModel) => {
return ((danmaku.time - live.startAt) / 1000).toFixed(3) return ((danmaku.time - live.startAt) / 1000).toFixed(3)
} }
return builder.build(xmlJsonObj) return builder.build(xmlJsonObj)

View File

@@ -1,12 +1,12 @@
import { QueryGetAPI } from '@/api/query' import { QueryGetAPI } from '@/api/query'
import { BASE_API, apiFail } from '@/data/constants' import { BASE_API, apiFail } from '@/data/constants'
import EasySpeech from 'easy-speech'
import { NText, createDiscreteApi } from 'naive-ui'
import { createApp, h } from 'vue' import { createApp, h } from 'vue'
import App from './App.vue' import App from './App.vue'
import router from './router'
import { GetSelfAccount, UpdateAccountLoop } from './api/account' import { GetSelfAccount, UpdateAccountLoop } from './api/account'
import { GetNotifactions } from './data/notifactions' import { GetNotifactions } from './data/notifactions'
import { NText, createDiscreteApi } from 'naive-ui' import router from './router'
import EasySpeech from 'easy-speech'
createApp(App).use(router).mount('#app') createApp(App).use(router).mount('#app')
@@ -17,18 +17,18 @@ QueryGetAPI<string>(BASE_API() + 'vtsuru/version')
if (version.code == 200) { if (version.code == 200) {
currentVersion = version.data currentVersion = version.data
const savedVersion = localStorage.getItem('Version') const savedVersion = localStorage.getItem('Version')
localStorage.setItem('Version', currentVersion)
if (currentVersion && savedVersion && savedVersion !== currentVersion) { if (currentVersion && savedVersion && savedVersion !== currentVersion) {
//alert('发现新的版本更新, 请按 Ctrl+F5 强制刷新页面') //alert('发现新的版本更新, 请按 Ctrl+F5 强制刷新页面')
notification.info({ notification.info({
title: '发现新的版本更新', title: '发现新的版本更新',
content: '请按 Ctrl+F5 强制刷新页面', content: '将自动刷新页面',
duration: 5000, duration: 5000,
meta: () => h(NText, { depth: 3 }, () => currentVersion), meta: () => h(NText, { depth: 3 }, () => currentVersion),
}) })
location.reload()
} }
localStorage.setItem('Version', currentVersion)
} }
}) })
.catch(() => { .catch(() => {
@@ -40,7 +40,7 @@ QueryGetAPI<string>(BASE_API() + 'vtsuru/version')
GetSelfAccount() GetSelfAccount()
GetNotifactions() GetNotifactions()
UpdateAccountLoop() UpdateAccountLoop()
InitTTS(); InitTTS()
}) })
function InitTTS() { function InitTTS() {
try { try {

View File

@@ -18,7 +18,6 @@ import {
VideoAdd20Filled, VideoAdd20Filled,
} from '@vicons/fluent' } from '@vicons/fluent'
import { AnalyticsSharp, BrowsersOutline, Chatbox, Moon, MusicalNote, Sunny } from '@vicons/ionicons5' import { AnalyticsSharp, BrowsersOutline, Chatbox, Moon, MusicalNote, Sunny } from '@vicons/ionicons5'
import { computed } from '@vue/reactivity'
import { useElementSize, useStorage } from '@vueuse/core' import { useElementSize, useStorage } from '@vueuse/core'
import { import {
NAlert, NAlert,
@@ -42,7 +41,7 @@ import {
NTooltip, NTooltip,
useMessage, useMessage,
} from 'naive-ui' } from 'naive-ui'
import { h, onMounted, ref } from 'vue' import { computed, h, onMounted, ref } from 'vue'
import { RouterLink, useRoute } from 'vue-router' import { RouterLink, useRoute } from 'vue-router'
import DanmakuLayout from './manage/DanmakuLayout.vue' import DanmakuLayout from './manage/DanmakuLayout.vue'

View File

@@ -21,11 +21,14 @@ const message = useMessage()
const resetEmailModalVisiable = ref(false) const resetEmailModalVisiable = ref(false)
const resetPasswordModalVisiable = ref(false) const resetPasswordModalVisiable = ref(false)
const bindBiliCodeModalVisiable = ref(false) const bindBiliCodeModalVisiable = ref(false)
const resetNameModalVisiable = ref(false)
const newEmailAddress = ref('') const newEmailAddress = ref('')
const newEmailVerifyCode = ref('') const newEmailVerifyCode = ref('')
const canSendEmailVerifyCode = ref(true) const canSendEmailVerifyCode = ref(true)
const newName = ref('')
const oldPassword = ref('') const oldPassword = ref('')
const newPassword = ref('') const newPassword = ref('')
const newPassword2 = ref('') const newPassword2 = ref('')
@@ -107,6 +110,26 @@ async function resetPassword() {
message.error('发生错误') message.error('发生错误')
}) })
} }
async function resetName() {
if (accountInfo.value?.name == newName.value) {
message.error('新用户名与旧用户名一致')
return
}
await QueryGetAPI(ACCOUNT_API_URL + 'verify/reset-name', { name: newName.value })
.then(async (data) => {
if (data.code == 200) {
message.success('用户名已修改')
setTimeout(() => {
location.reload()
}, 1000)
} else {
message.error(data.message)
}
})
.catch((err) => {
message.error('发生错误')
})
}
async function BindBili() { async function BindBili() {
if (!biliCode.value) { if (!biliCode.value) {
message.error('身份码不能为空') message.error('身份码不能为空')
@@ -276,6 +299,14 @@ async function ChangeBili() {
<NButton @click="resetPassword" type="warning"> 确定修改 </NButton> <NButton @click="resetPassword" type="warning"> 确定修改 </NButton>
</template> </template>
</NModal> </NModal>
<NModal v-model:show="resetNameModalVisiable" preset="card" title="修改用户名" style="width: 400px; max-width: 90%">
<NSpace vertical>
<NInput v-model:value="newName" type="password" placeholder="新用户名" />
</NSpace>
<template #footer>
<NButton @click="resetName" type="warning"> 确定修改 </NButton>
</template>
</NModal>
<NModal v-model:show="bindBiliCodeModalVisiable" preset="card" title="绑定/更新身份码" style="width: 400px; max-width: 90%"> <NModal v-model:show="bindBiliCodeModalVisiable" preset="card" title="绑定/更新身份码" style="width: 400px; max-width: 90%">
<NSpace vertical> <NSpace vertical>
<NInputGroup> <NInputGroup>

View File

@@ -559,6 +559,9 @@ onMounted(async () => {
<NPagination v-model:page="fivesingCurrentPage" :page-count="fivesingTotalPageCount" simple @update-page="getFivesingSearchList(false)" /> <NPagination v-model:page="fivesingCurrentPage" :page-count="fivesingTotalPageCount" simple @update-page="getFivesingSearchList(false)" />
</template> </template>
</NTabPane> </NTabPane>
<NTabPane name="file" tab="从文件导入">
开发中...
</NTabPane>
</NTabs> </NTabs>
</NSpin> </NSpin>
</NModal> </NModal>

View File

@@ -1,9 +1,9 @@
// vite.config.ts // vite.config.ts
import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue';
import vue from '@vitejs/plugin-vue'
import path from 'path'
import svgLoader from 'vite-svg-loader'
import vueJsx from '@vitejs/plugin-vue-jsx'; import vueJsx from '@vitejs/plugin-vue-jsx';
import path from 'path';
import { defineConfig } from 'vite';
import svgLoader from 'vite-svg-loader';
export default defineConfig({ export default defineConfig({
plugins: [vue({ plugins: [vue({

8934
yarn.lock

File diff suppressed because it is too large Load Diff