删除无用组件及其路由
This commit is contained in:
parent
ad6743656b
commit
a5ee34e6fb
@ -2,21 +2,12 @@
|
|||||||
// import UserDetail from '../views/user-management/UserDetail.vue'
|
// import UserDetail from '../views/user-management/UserDetail.vue'
|
||||||
// import UserEdit from '../views/user-management/UserEdit.vue'
|
// import UserEdit from '../views/user-management/UserEdit.vue'
|
||||||
|
|
||||||
import Home from "../views/user-management/Home.vue";
|
|
||||||
import Register from "../views/user-management/Register.vue";
|
|
||||||
import TenantManagement from "../views/user-management/TenantManagement.vue";
|
import TenantManagement from "../views/user-management/TenantManagement.vue";
|
||||||
import AddUser from "../views/user-management/AddUser.vue";
|
import AddUser from "../views/user-management/AddUser.vue";
|
||||||
import AddTenant from "../views/user-management/AddTenant.vue";
|
import AddTenant from "../views/user-management/AddTenant.vue";
|
||||||
import UserManagement from "../views/user-management/UserManagement.vue";
|
import UserManagement from "../views/user-management/UserManagement.vue";
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{ path: '/', component: Home},
|
|
||||||
{ path: '/login', name: 'App', component:Home },
|
|
||||||
{
|
|
||||||
path: '/register',
|
|
||||||
name: 'Register',
|
|
||||||
component: Register
|
|
||||||
},
|
|
||||||
{ path: '/tenantManagement',
|
{ path: '/tenantManagement',
|
||||||
name: 'TenantManagement',
|
name: 'TenantManagement',
|
||||||
component: TenantManagement
|
component: TenantManagement
|
||||||
|
|||||||
@ -1,64 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-card class="login-container" shadow="hover">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-text class="mx-1" type="primary">名称</el-text>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="18">
|
|
||||||
<el-input v-model="account" placeholder="请输入账号" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row style="margin-top: 20px;">
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-text class="mx-1" type="primary">密码</el-text>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="18">
|
|
||||||
<el-input v-model="password" placeholder="请输入密码" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row style="margin-top: 20px;">
|
|
||||||
<el-col :offset="6" :span="9">
|
|
||||||
<el-button type="primary" @click="handleLogin">登录</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="9">
|
|
||||||
<el-button type="primary" @click="handleRegister">注册</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import authenticationService from "../../services/authenticationService.js";
|
|
||||||
import {useRouter} from "vue-router";
|
|
||||||
import {ref} from "vue";
|
|
||||||
|
|
||||||
const account = ref('');
|
|
||||||
const password = ref('');
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const handleLogin = () => {
|
|
||||||
authenticationService.login(account.value, password.value).then(res => {
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleRegister = () => {
|
|
||||||
router.push('/register');
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.login-container {
|
|
||||||
background-color: #333; /* 深色背景 */
|
|
||||||
color: white; /* 确保文本颜色与深色背景有对比 */
|
|
||||||
padding: 20px;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-text {
|
|
||||||
color: white; /* 确保文本颜色与深色背景有对比 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-input {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,108 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="form-container">
|
|
||||||
<div class="form-item">
|
|
||||||
<el-text class="label" type="primary">名称</el-text>
|
|
||||||
<el-input v-model="name" class="input" placeholder="请输入名称" />
|
|
||||||
</div>
|
|
||||||
<div class="form-item">
|
|
||||||
<el-text class="label" type="primary">账号</el-text>
|
|
||||||
<el-input v-model="account" class="input" placeholder="请输入账号" />
|
|
||||||
</div>
|
|
||||||
<div class="form-item">
|
|
||||||
<el-text class="label" type="primary">密码</el-text>
|
|
||||||
<el-input v-model="password" class="input" placeholder="请输入密码" />
|
|
||||||
</div>
|
|
||||||
<div class="form-item">
|
|
||||||
<el-text class="label" type="primary">性别</el-text>
|
|
||||||
<el-input v-model="gender" class="input" placeholder="请输入性别" />
|
|
||||||
</div>
|
|
||||||
<div class="form-item">
|
|
||||||
<el-text class="label" type="primary">电话号码</el-text>
|
|
||||||
<el-input v-model="phone" class="input" placeholder="请输入电话号码" />
|
|
||||||
</div>
|
|
||||||
<div class="form-item">
|
|
||||||
<el-text class="label" type="primary">邮箱</el-text>
|
|
||||||
<el-input v-model="email" class="input" placeholder="请输入邮箱" />
|
|
||||||
</div>
|
|
||||||
<div class="form-item">
|
|
||||||
<el-text class="label" type="primary">组织</el-text>
|
|
||||||
<el-input v-model="organization" class="input" placeholder="请输入组织" />
|
|
||||||
</div>
|
|
||||||
<el-button plain @click="open" class="register-button">注册</el-button>
|
|
||||||
<router-view></router-view>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
||||||
import type { Action } from 'element-plus'
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import authenticationService from "../../services/authenticationService.js";
|
|
||||||
|
|
||||||
const name = ref<string>('');
|
|
||||||
const password = ref<string>('');
|
|
||||||
const gender = ref<string>('');
|
|
||||||
const phone = ref<string>('');
|
|
||||||
const email = ref<string>('');
|
|
||||||
const organization = ref<string>('');
|
|
||||||
const account = ref<string>('');
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const open = () => {
|
|
||||||
const user = {
|
|
||||||
account: account.value,
|
|
||||||
password: password.value,
|
|
||||||
name: name.value,
|
|
||||||
organization: organization.value,
|
|
||||||
email: email.value,
|
|
||||||
gender: gender.value,
|
|
||||||
phone: phone.value,
|
|
||||||
};
|
|
||||||
authenticationService.register(user).then(res => {
|
|
||||||
alert(res);
|
|
||||||
});
|
|
||||||
ElMessageBox.alert('注册成功', '提示', {
|
|
||||||
confirmButtonText: 'OK',
|
|
||||||
callback: (action: Action) => {
|
|
||||||
ElMessage({
|
|
||||||
type: 'info',
|
|
||||||
message: `action: ${action}`,
|
|
||||||
});
|
|
||||||
// 跳转到 /login 页面
|
|
||||||
router.push('/login');
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.form-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.label {
|
|
||||||
width: 100px;
|
|
||||||
text-align: right;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
width: 240px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-button {
|
|
||||||
margin-left: 110px; /* Adjust to align with the inputs */
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Loading…
Reference in New Issue
Block a user