Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
adminCenter
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
adminCenter
Commits
a4f75e05
提交
a4f75e05
authored
4月 16, 2024
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
4ed03d72
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
48 行增加
和
2 行删除
+48
-2
components.d.ts
src/types/components.d.ts
+1
-0
index.vue
src/views/login/index.vue
+47
-2
没有找到文件。
src/types/components.d.ts
浏览文件 @
a4f75e05
...
...
@@ -7,6 +7,7 @@ export {}
declare
module
'vue'
{
export
interface
GlobalComponents
{
ElAlert
:
typeof
import
(
'element-plus/es'
)[
'ElAlert'
]
ElAside
:
typeof
import
(
'element-plus/es'
)[
'ElAside'
]
ElButton
:
typeof
import
(
'element-plus/es'
)[
'ElButton'
]
ElCol
:
typeof
import
(
'element-plus/es'
)[
'ElCol'
]
...
...
src/views/login/index.vue
浏览文件 @
a4f75e05
<
template
>
<div
class=
"container"
>
<el-alert
title=
"账号密码暂时无效,点击登录即可"
type=
"warning"
class=
"alert"
:closable=
"false"
center
/>
<form
action=
"#"
class=
"login-form"
>
<el-form
class=
"login-container"
label-position=
"left"
label-width=
"0px"
>
<h2
class=
"login_title"
>
系统登录
</h2>
...
...
@@ -21,7 +29,17 @@
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
style=
"width: 120px"
@
click=
"login"
>
登录
</el-button>
<div
class=
"login-btn"
>
<el-button
type=
"primary"
style=
"width: 120px"
@
click=
"login"
>
登录
</el-button>
<el-upload
:action=
"action"
:show-file-list=
"false"
:on-success=
"onUpload"
style=
"margin-bottom: 20px"
>
<el-button
v-if=
"flag"
type=
"primary"
style=
"margin-left: 20px"
>
新增租户
</el-button>
</el-upload>
</div>
</el-form-item>
</el-form>
</form>
...
...
@@ -33,21 +51,40 @@ import { useTenantStore } from '@/stores/modules/tenant'
const
tenantStore
=
useTenantStore
()
const
action
=
'/admin/api/lic/info/file/import'
const
loginForm
=
ref
({
username
:
''
,
password
:
''
})
const
flag
=
ref
(
false
)
const
router
=
useRouter
()
const
onUpload
=
async
(
res
:
any
)
=>
{
try
{
if
(
res
.
code
===
200
)
{
router
.
push
(
'/tenant'
)
flag
.
value
=
false
ElMessage
.
success
(
'导入成功'
)
}
else
ElMessage
.
error
(
res
.
msg
)
}
finally
{
await
tenantStore
.
initTenantList
()
}
}
const
login
=
()
=>
{
tenantStore
.
initTenantList
().
then
(()
=>
{
router
.
push
(
'/tenant'
)
if
(
tenantStore
.
getTenantList
.
length
)
router
.
push
(
'/tenant'
)
else
{
ElMessage
.
error
(
'租户不存在,请先导入租户信息'
)
flag
.
value
=
true
}
})
}
</
script
>
<
style
scoped
>
.container
{
position
:
relative
;
width
:
100vw
;
height
:
100vh
;
display
:
flex
;
...
...
@@ -55,6 +92,10 @@ const login = () => {
justify-content
:
center
;
background-color
:
#0000001
f
;
}
.alert
{
position
:
absolute
;
top
:
2%
;
}
.login-form
{
width
:
240px
;
...
...
@@ -142,4 +183,8 @@ h2 {
display
:
flex
;
justify-content
:
center
;
}
.login-btn
{
display
:
flex
;
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论