Skip to content

Commit

Permalink
feat(User)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZvonimirSun committed Mar 20, 2024
1 parent 6172bca commit cb9e2fa
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
38 changes: 21 additions & 17 deletions src/tools/internal/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ async function login() {
}
}
function register() {
router.push('/register')
}
function getOtherQuery(query: LocationQuery) {
// eslint-disable-next-line unused-imports/no-unused-vars
const { redirect, ...result } = query
Expand Down Expand Up @@ -99,17 +103,23 @@ function getOtherQuery(query: LocationQuery) {
</el-input>
</el-form-item>
<el-form-item>
<div class="btn-wrapper">
<el-button
type="primary"
block
size="large"
:loading="loading"
@click="login"
>
登录
</el-button>
</div>
<el-button
type="primary"
block
size="large"
:loading="loading"
@click="login"
>
登录
</el-button>
<el-button
block
size="large"
:disabled="loading"
@click="register"
>
注册
</el-button>
</el-form-item>
</el-form>
</div>
Expand All @@ -129,10 +139,4 @@ function getOtherQuery(query: LocationQuery) {
margin: 0 auto;
}
}
.btn-wrapper {
width: 100%;
display: flex;
gap: 8px;
}
</style>
12 changes: 12 additions & 0 deletions src/tools/internal/register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ function register() {
function resetFields() {
registerFormRef.value?.resetFields()
}
function login() {
router.push('/login')
}
</script>

<template>
Expand Down Expand Up @@ -243,6 +247,14 @@ function resetFields() {
>
重置
</el-button>
<el-button
block
size="large"
:disabled="loading"
@click="login"
>
返回登录
</el-button>
</el-form-item>
</el-form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/internal/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async function updateUser(formEl: FormInstance | undefined) {
角色
</div>
<div>
{{ userStore.profile?.roles?.[0]?.alias ?? '普通用户' }}
{{ userStore.profile?.roles?.[0]?.alias ?? '注册用户' }}
</div>
</div>
<div
Expand Down

0 comments on commit cb9e2fa

Please sign in to comment.