feat: 支持数据库运行时配置与多数据库,重构设置页并完善打包
- 数据库支持 SQLite / MySQL 运行时配置与切换,未配置时仍可启动,配置后自动建表 - 新增默认分类与标签初始化,注册用户自动创建 - 新增注册开关(默认关闭,可在系统设置开启;无用户时允许创建首个账号) - 合并数据库、注册与 AI 配置为「系统设置」页,拆分「模型使用情况」独立页面 - AI 一键设置支持新建分类与标签 - 前端构建产物打包进可执行 jar,后端增加 SPA 路由回退 - jar 更名为 finance-app,补全 Gradle Wrapper,移除 archive 任务 - 更新 DeepSeek 模型说明文案
This commit is contained in:
@@ -1,18 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
// 登录页面组件:提供用户名/密码表单,验证后跳转至首页
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useMessage, NCard, NForm, NFormItem, NInput, NButton, NSpace } from 'naive-ui'
|
||||
import { login } from '../api/user'
|
||||
import { useUserStore } from '../store/user'
|
||||
import { useRegistrationStore } from '../store/registration'
|
||||
import LocaleSwitch from '../components/LocaleSwitch.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const message = useMessage() // 消息提示工具
|
||||
const userStore = useUserStore() // 用户状态管理
|
||||
const registrationStore = useRegistrationStore() // 注册状态管理
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
// 是否显示注册入口:注册开关开启或系统尚无用户时显示
|
||||
const canRegister = computed(() => registrationStore.status?.allowed ?? false)
|
||||
|
||||
onMounted(async () => {
|
||||
if (!registrationStore.loaded) {
|
||||
await registrationStore.load()
|
||||
}
|
||||
})
|
||||
|
||||
// 登录表单数据
|
||||
const form = ref({
|
||||
username: '',
|
||||
@@ -56,7 +67,7 @@ async function handleLogin() {
|
||||
</NFormItem>
|
||||
<NSpace vertical>
|
||||
<NButton type="primary" block :loading="loading" @click="handleLogin">{{ t('login.submit') }}</NButton>
|
||||
<NButton text type="info" @click="router.push('/register')">{{ t('login.toRegister') }}</NButton>
|
||||
<NButton v-if="canRegister" text type="info" @click="router.push('/register')">{{ t('login.toRegister') }}</NButton>
|
||||
</NSpace>
|
||||
</NForm>
|
||||
</NCard>
|
||||
|
||||
Reference in New Issue
Block a user