feat(frontend): 增加两个token的输入框
构建上传工具 / build (push) Failing after 2m46s

This commit is contained in:
2026-07-26 18:09:59 +08:00
parent e15debc962
commit b0ee886b75
3 changed files with 28 additions and 10 deletions
+20 -8
View File
@@ -9,7 +9,8 @@ import {configModel} from "@/model.ts";
import Config = config.Config; import Config = config.Config;
// const serverUrl = ref('') // const serverUrl = ref('')
const token = ref('') const hasVideoToken = ref('')
const noVideoToken = ref('')
const checkDir = ref('') const checkDir = ref('')
const concurrentFiles = ref(1) const concurrentFiles = ref(1)
const uploadThreads = ref(1) const uploadThreads = ref(1)
@@ -71,8 +72,8 @@ const startRun = () => {
// ElMessage.warning('请输入服务器地址') // ElMessage.warning('请输入服务器地址')
// return // return
// } // }
if (!token.value) { if (!hasVideoToken.value || !noVideoToken.value) {
ElMessage.error('请输入Token') ElMessage.error('请输入两个上传 Token')
return return
} }
if (!checkDir.value) { if (!checkDir.value) {
@@ -105,8 +106,11 @@ const clearLog = () => {
// const writeServerUrl =() => { // const writeServerUrl =() => {
// WriteConfig("url", serverUrl.value) // WriteConfig("url", serverUrl.value)
// } // }
const writeToken = () => { const writeHasVideoToken = () => {
WriteConfig(configModel.Token, token.value) WriteConfig(configModel.HasVideoToken, hasVideoToken.value)
}
const writeNoVideoToken = () => {
WriteConfig(configModel.NoVideoToken, noVideoToken.value)
} }
const writeCheckDir = () => { const writeCheckDir = () => {
WriteConfig(configModel.CheckDir, checkDir.value) WriteConfig(configModel.CheckDir, checkDir.value)
@@ -125,7 +129,8 @@ const writeUploadThreads = () => {
try { try {
GetConfig().then((config: Config) => { GetConfig().then((config: Config) => {
// serverUrl.value = config.url // 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 checkDir.value = config.check_dir
concurrentFiles.value = config.handle_file_count concurrentFiles.value = config.handle_file_count
uploadThreads.value = config.thread_count uploadThreads.value = config.thread_count
@@ -168,8 +173,15 @@ try {
<!-- </div>--> <!-- </div>-->
<div class="form-item"> <div class="form-item">
<label>Token</label> <label>有视频 Token</label>
<el-input v-model="token" placeholder="请输入Token" :disabled="isRunning" @change="writeToken()"/> <el-input v-model="hasVideoToken" placeholder="有视频账号上传使用的 Token" :disabled="isRunning"
@change="writeHasVideoToken()"/>
</div>
<div class="form-item">
<label>无视频 Token</label>
<el-input v-model="noVideoToken" placeholder="无视频账号上传使用的 Token" :disabled="isRunning"
@change="writeNoVideoToken()"/>
</div> </div>
<div class="form-item"> <div class="form-item">
+2
View File
@@ -1,6 +1,8 @@
export enum configModel { export enum configModel {
Url = "url", Url = "url",
Token = "token", Token = "token",
HasVideoToken = "has-video-token",
NoVideoToken = "no-video-token",
ThreadCount = "thread-count", ThreadCount = "thread-count",
HandleFileCount = "handle-file-count", HandleFileCount = "handle-file-count",
IsRunOnStart = "is-run-on-start", IsRunOnStart = "is-run-on-start",
+4
View File
@@ -3,6 +3,8 @@ export namespace config {
export class Config { export class Config {
url: string; url: string;
token: string; token: string;
has_video_token: string;
no_video_token: string;
thread_count: number; thread_count: number;
handle_file_count: number; handle_file_count: number;
is_run_on_start: boolean; is_run_on_start: boolean;
@@ -17,6 +19,8 @@ export namespace config {
if ('string' === typeof source) source = JSON.parse(source); if ('string' === typeof source) source = JSON.parse(source);
this.url = source["url"]; this.url = source["url"];
this.token = source["token"]; 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.thread_count = source["thread_count"];
this.handle_file_count = source["handle_file_count"]; this.handle_file_count = source["handle_file_count"];
this.is_run_on_start = source["is_run_on_start"]; this.is_run_on_start = source["is_run_on_start"];