From b0ee886b755a616d67c8150191597dd8e6444930 Mon Sep 17 00:00:00 2001 From: YGXB_net Date: Sun, 26 Jul 2026 18:09:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E5=A2=9E=E5=8A=A0=E4=B8=A4?= =?UTF-8?q?=E4=B8=AAtoken=E7=9A=84=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 30 +++++++++++++++++++++--------- frontend/src/model.ts | 4 +++- frontend/wailsjs/go/models.ts | 4 ++++ 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index f7e2a39..7798064 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -9,7 +9,8 @@ import {configModel} from "@/model.ts"; import Config = config.Config; // const serverUrl = ref('') -const token = ref('') +const hasVideoToken = ref('') +const noVideoToken = ref('') const checkDir = ref('') const concurrentFiles = ref(1) const uploadThreads = ref(1) @@ -71,8 +72,8 @@ const startRun = () => { // ElMessage.warning('请输入服务器地址') // return // } - if (!token.value) { - ElMessage.error('请输入Token') + if (!hasVideoToken.value || !noVideoToken.value) { + ElMessage.error('请输入两个上传 Token') return } if (!checkDir.value) { @@ -105,8 +106,11 @@ const clearLog = () => { // const writeServerUrl =() => { // WriteConfig("url", serverUrl.value) // } -const writeToken = () => { - WriteConfig(configModel.Token, token.value) +const writeHasVideoToken = () => { + WriteConfig(configModel.HasVideoToken, hasVideoToken.value) +} +const writeNoVideoToken = () => { + WriteConfig(configModel.NoVideoToken, noVideoToken.value) } const writeCheckDir = () => { WriteConfig(configModel.CheckDir, checkDir.value) @@ -125,7 +129,8 @@ const writeUploadThreads = () => { try { GetConfig().then((config: Config) => { // serverUrl.value = config.url - token.value = config.token + hasVideoToken.value = config.has_video_token + noVideoToken.value = config.no_video_token checkDir.value = config.check_dir concurrentFiles.value = config.handle_file_count uploadThreads.value = config.thread_count @@ -168,8 +173,15 @@ try {
- - + + +
+ +
+ +
@@ -352,4 +364,4 @@ try { .log-line:hover { background: #2d2d2d; } - \ No newline at end of file + diff --git a/frontend/src/model.ts b/frontend/src/model.ts index 6f7c9fc..3a8e4fd 100644 --- a/frontend/src/model.ts +++ b/frontend/src/model.ts @@ -1,9 +1,11 @@ export enum configModel { Url = "url", Token = "token", + HasVideoToken = "has-video-token", + NoVideoToken = "no-video-token", ThreadCount = "thread-count", HandleFileCount = "handle-file-count", IsRunOnStart = "is-run-on-start", CheckDir = "check-dir", ClearFilesNoPrompt = "clear-files-no-prompt", -} \ No newline at end of file +} diff --git a/frontend/wailsjs/go/models.ts b/frontend/wailsjs/go/models.ts index b1ba753..44df1b2 100644 --- a/frontend/wailsjs/go/models.ts +++ b/frontend/wailsjs/go/models.ts @@ -3,6 +3,8 @@ export namespace config { export class Config { url: string; token: string; + has_video_token: string; + no_video_token: string; thread_count: number; handle_file_count: number; is_run_on_start: boolean; @@ -17,6 +19,8 @@ export namespace config { if ('string' === typeof source) source = JSON.parse(source); this.url = source["url"]; this.token = source["token"]; + this.has_video_token = source["has_video_token"]; + this.no_video_token = source["no_video_token"]; this.thread_count = source["thread_count"]; this.handle_file_count = source["handle_file_count"]; this.is_run_on_start = source["is_run_on_start"];