chore: 项目环境升级为 JDK25,Spring 4.1,项目重构为多模块

This commit is contained in:
2026-09-08 15:02:18 +08:00
parent d392436620
commit 81a0d81f11
168 changed files with 2785 additions and 1375 deletions

View File

@@ -0,0 +1,18 @@
{
"name": "@manuagent/admin",
"private": true,
"version": "0.1.0",
"type": "module",
"exports": {
".": "./src/index.ts"
},
"dependencies": {
"@manuagent/common": "0.1.0",
"vue": "3.5.41",
"vue-router": "^4.6.3",
"element-plus": "2.14.5"
},
"scripts": {
"typecheck": "vue-tsc --noEmit -p tsconfig.json"
}
}

View File

@@ -0,0 +1,9 @@
import { api, resetCsrf } from '@manuagent/common'
export function login(username: string, password: string) {
resetCsrf()
return api('/api/auth/login', {
method: 'POST',
body: JSON.stringify({ username, password })
})
}

View File

@@ -0,0 +1,2 @@
export { default as LoginPage } from './pages/LoginPage.vue'
export { login } from './api'

View File

@@ -0,0 +1,46 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { login } from '../api'
const props = defineProps<{ destination: string }>()
const router = useRouter()
const username = ref('admin')
const password = ref('admin123')
const loading = ref(false)
const error = ref('')
async function submit() {
if (loading.value) return
loading.value = true
error.value = ''
try {
await login(username.value, password.value)
await router.replace(props.destination)
} catch (reason) {
error.value = reason instanceof Error ? reason.message : '登录失败'
} finally {
loading.value = false
}
}
</script>
<template>
<main class="login-page">
<form class="login-panel" @submit.prevent="submit">
<div class="brand large"></div>
<h1>智造申报 Agent</h1>
<el-input v-model="username" autocomplete="username" aria-label="用户名" placeholder="用户名" />
<el-input
v-model="password"
type="password"
show-password
autocomplete="current-password"
aria-label="密码"
placeholder="密码"
/>
<p v-if="error" class="form-error">{{ error }}</p>
<el-button native-type="submit" type="primary" :loading="loading" class="full-button">登录</el-button>
</form>
</main>
</template>

View File

@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"include": [
"src/**/*.ts",
"src/**/*.vue"
]
}