This commit is contained in:
+20
-8
@@ -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 {
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="form-item">
|
||||
<label>Token</label>
|
||||
<el-input v-model="token" placeholder="请输入Token" :disabled="isRunning" @change="writeToken()"/>
|
||||
<label>有视频 Token</label>
|
||||
<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 class="form-item">
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
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",
|
||||
|
||||
@@ -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"];
|
||||
|
||||
Reference in New Issue
Block a user