This commit is contained in:
Zyronon
2025-10-19 03:55:13 +08:00
parent ad1bdf4690
commit 03e38d1ce6
6 changed files with 37 additions and 9 deletions

View File

@@ -6,8 +6,9 @@ import router from "@/router.ts";
onMounted(() => {
if (!IS_LOGIN) {
router.push({path: "/login"});
}
router.push({path: "/login"});
})
</script>

View File

@@ -2,16 +2,26 @@
import BaseInput from "@/components/base/BaseInput.vue";
import BaseButton from "@/components/BaseButton.vue";
import { APP_NAME } from "@/config/env.ts";
import { uploadImportData } from "@/apis";
function sync() {
}
function handleAudioChange(e) {
let uploadFile = e.target?.files?.[0]
if (!uploadFile) return
let data = new FormData();
data.append("file", uploadFile);
uploadImportData(data)
console.log(uploadFile)
}
</script>
<template>
<div class="center h-screen">
<div class="center flex flex-col gap-6">
<h1 class="mb-0">{{ APP_NAME }}</h1>
<div class=" flex flex-col gap-6 w-100">
<h1 class="mb-0 text-align-center">{{ APP_NAME }}</h1>
<div class="flex center">
<span class="shrink-0">账户</span>
<BaseInput type="text"/>
@@ -22,6 +32,13 @@ function sync() {
</div>
<BaseButton class="w-full">登录</BaseButton>
<BaseButton class="w-full" @click="sync">同步</BaseButton>
<div class="upload relative">
<BaseButton>上传</BaseButton>
<input type="file"
accept=".zip,.json"
@change="handleAudioChange"
class="w-full h-full absolute left-0 top-0 opacity-0"/>
</div>
<div class="w-full flex justify-end gap-4">
<div>注册</div>

View File

@@ -26,9 +26,8 @@ import { getCurrentStudyWord } from "@/hooks/dict.ts";
import PracticeSettingDialog from "@/pages/word/components/PracticeSettingDialog.vue";
import { useSettingStore } from "@/stores/setting.ts";
import { MessageBox } from "@/utils/MessageBox.tsx";
import { CAN_REQUEST, Origin } from "@/config/env.ts";
import { CAN_REQUEST, Origin, PracticeSaveWordKey } from "@/config/env.ts";
import { detail } from "@/apis";
import { PracticeSaveWordKey } from "@/utils/const.ts";
const runtimeStore = useRuntimeStore()
const base = useBaseStore()
@@ -369,7 +368,7 @@ async function exportData() {
}
function searchWord() {
console.log('wordForm.word',wordForm.word)
console.log('wordForm.word', wordForm.word)
}
defineRender(() => {