Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
integrate-admin
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
integrate-admin
Commits
dad7d12b
提交
dad7d12b
authored
1月 11, 2023
作者:
inroi
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
http://192.168.0.27:8090/xuxu/integrate-admin
上级
7a728ee4
4881991c
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
6 行删除
+20
-6
useLogin.ts
src/services/business/login/useLogin.ts
+4
-0
menu.ts
src/store/modules/menu.ts
+11
-5
login.vue
src/views/login/login.vue
+5
-1
没有找到文件。
src/services/business/login/useLogin.ts
浏览文件 @
dad7d12b
...
@@ -5,6 +5,7 @@ import { ElNotification } from 'element-plus';
...
@@ -5,6 +5,7 @@ import { ElNotification } from 'element-plus';
import
router
from
'@/router/index'
import
router
from
'@/router/index'
export
default
function
useLogin
(
loginModel
:
LoginParm
)
{
export
default
function
useLogin
(
loginModel
:
LoginParm
)
{
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
num
=
ref
(
0
)
//登录提交
//登录提交
const
login
=
async
()
=>
{
const
login
=
async
()
=>
{
//表单验证
//表单验证
...
@@ -24,6 +25,7 @@ export default function useLogin(loginModel: LoginParm) {
...
@@ -24,6 +25,7 @@ export default function useLogin(loginModel: LoginParm) {
router
.
push
({
path
:
'/'
})
router
.
push
({
path
:
'/'
})
},
1500
)
},
1500
)
}
else
{
}
else
{
num
.
value
++
// ElNotification({
// ElNotification({
// title:'登陆失败',
// title:'登陆失败',
// message:res.msg,
// message:res.msg,
...
@@ -45,6 +47,7 @@ export default function useLogin(loginModel: LoginParm) {
...
@@ -45,6 +47,7 @@ export default function useLogin(loginModel: LoginParm) {
const
loginState
=
ref
(
false
)
const
loginState
=
ref
(
false
)
return
{
return
{
login
,
login
,
num
,
loginState
loginState
}
}
}
}
\ No newline at end of file
src/store/modules/menu.ts
浏览文件 @
dad7d12b
...
@@ -2,6 +2,7 @@ import { getMenuListApi } from "@/services/api/menu/menuAPI";
...
@@ -2,6 +2,7 @@ import { getMenuListApi } from "@/services/api/menu/menuAPI";
import
{
RouteRecordRaw
}
from
"vue-router"
;
import
{
RouteRecordRaw
}
from
"vue-router"
;
import
{
ActionContext
}
from
"vuex"
;
import
{
ActionContext
}
from
"vuex"
;
import
{
RootState
}
from
".."
;
import
{
RootState
}
from
".."
;
import
{
ElNotification
}
from
"element-plus"
;
import
Layout
from
"@/layout/index.vue"
;
import
Layout
from
"@/layout/index.vue"
;
const
modules
=
import
.
meta
.
glob
(
"../../views/**/*.vue"
);
const
modules
=
import
.
meta
.
glob
(
"../../views/**/*.vue"
);
//定义state
//定义state
...
@@ -50,11 +51,15 @@ export const actions = {
...
@@ -50,11 +51,15 @@ export const actions = {
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getMenuListApi
()
getMenuListApi
()
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
/* res.data.forEach(item => {
if
(
res
.
data
.
length
===
0
)
{
if (item.meta.title === '部门') {
ElNotification
({
item.children = []
title
:
'获取权限失败'
,
}
message
:
'该账号没有后台权限,请联系管理员授权'
,
}) */
type
:
'error'
,
})
sessionStorage
.
clear
()
return
window
.
location
.
href
=
"/#/login"
;
}
else
{
let
accessedRoutes
;
let
accessedRoutes
;
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
//动态生成路由
//动态生成路由
...
@@ -64,6 +69,7 @@ export const actions = {
...
@@ -64,6 +69,7 @@ export const actions = {
}
}
//返回
//返回
resolve
(
accessedRoutes
);
resolve
(
accessedRoutes
);
}
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
reject
(
error
);
reject
(
error
);
...
...
src/views/login/login.vue
浏览文件 @
dad7d12b
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
</div>
</div>
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
watch
}
from
"vue"
;
import
useImage
from
"@/services/business/login/useImage"
;
import
useImage
from
"@/services/business/login/useImage"
;
import
useBaseLogin
from
"@/services/business/login/useBaseLogin"
;
import
useBaseLogin
from
"@/services/business/login/useBaseLogin"
;
import
useLogin
from
"@/services/business/login/useLogin"
;
import
useLogin
from
"@/services/business/login/useLogin"
;
...
@@ -57,7 +58,10 @@ const { loginModel, rules, loginFormRef } = useBaseLogin();
...
@@ -57,7 +58,10 @@ const { loginModel, rules, loginFormRef } = useBaseLogin();
const
{
imgSrc
,
getImage
}
=
useImage
();
const
{
imgSrc
,
getImage
}
=
useImage
();
//登录
//登录
const
{
login
,
loginState
}
=
useLogin
(
loginModel
);
const
{
login
,
loginState
,
num
}
=
useLogin
(
loginModel
);
watch
(
num
,
()
=>
getImage
(),
{
deep
:
true
})
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.logincontainer
{
.logincontainer
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论