Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
GaoQuIncubator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kimber
GaoQuIncubator
Commits
1b5afb1b
Commit
1b5afb1b
authored
Oct 25, 2024
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页区分跳转问题处理,登录错误提示新增, 数据概览页面init
parent
979ae3bb
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1069 additions
and
51 deletions
+1069
-51
routers.js
src/router/routers.js
+14
-16
user.js
src/store/modules/user.js
+10
-4
index.vue
src/views/Screen/index.vue
+10
-9
overview.vue
src/views/system/home/overview.vue
+1007
-0
login.vue
src/views/system/user/login.vue
+28
-22
No files found.
src/router/routers.js
View file @
1b5afb1b
...
@@ -58,28 +58,26 @@ export const constantRouterMap = [
...
@@ -58,28 +58,26 @@ export const constantRouterMap = [
//component: Layout,
//component: Layout,
component
:
HomeLayout
,
component
:
HomeLayout
,
redirect
:
"
noredirect
"
,
redirect
:
"
noredirect
"
,
hidden
:
tru
e
,
hidden
:
fals
e
,
children
:
[
children
:
[
{
{
path
:
"
enterprise
"
,
path
:
"
enterprise
"
,
component
:
resolve
=>
require
([
"
@/views/system/home/enterprise
"
],
resolve
),
component
:
resolve
=>
require
([
localStorage
.
getItem
(
'
groupIdByloginType
'
)
*
1
===
1
?
"
@/views/system/home/enterprise
"
:
"
@/views/system/home/tech
"
],
resolve
),
name
:
"
首页-企业
"
,
name
:
"
首页-企业
"
,
meta
:
{
title
:
"
首页
"
,
affix
:
true
,
icon
:
"
index
"
}
meta
:
{
title
:
"
首页
"
,
affix
:
true
,
icon
:
"
index
"
}
}
},
]
// {
},
// path: "tech",
{
// component: resolve => require(["@/views/system/home/tech"], resolve),
path
:
"
/home
"
,
// name: "首页-科技局",
//component: Layout,
// meta: { title: "首页", affix:true , icon: "index"}
component
:
HomeLayout
,
// },
redirect
:
"
noredirect
"
,
hidden
:
true
,
children
:
[
{
{
path
:
"
tech
"
,
path
:
"
overview
"
,
component
:
resolve
=>
require
([
"
@/views/system/home/tech
"
],
resolve
),
component
:
resolve
=>
require
([
"
@/views/system/home/overview
"
],
resolve
),
name
:
"
首页-科技局
"
,
name
:
"
概览
"
,
meta
:
{
title
:
"
首页
"
,
affix
:
true
,
icon
:
"
index
"
}
hidden
:
true
,
meta
:
{
title
:
"
数据概览
"
,
icon
:
"
index
"
}
}
}
]
]
},
},
...
...
src/store/modules/user.js
View file @
1b5afb1b
import
{
login
,
getInfo
,
logout
}
from
'
@/api/login
'
import
{
login
,
getInfo
,
logout
}
from
'
@/api/login
'
import
{
getToken
,
setToken
,
removeToken
}
from
'
@/utils/auth
'
import
{
getToken
,
setToken
,
removeToken
}
from
'
@/utils/auth
'
import
{
Message
}
from
'
element-ui
'
;
const
user
=
{
const
user
=
{
state
:
{
state
:
{
token
:
getToken
(),
token
:
getToken
(),
...
@@ -34,7 +34,7 @@ const user = {
...
@@ -34,7 +34,7 @@ const user = {
const
rememberMe
=
userInfo
.
rememberMe
;
const
rememberMe
=
userInfo
.
rememberMe
;
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
login
(
userInfo
).
then
(
res
=>
{
login
(
userInfo
).
then
(
res
=>
{
if
(
/* res.head.code === '0000' || */
!
res
.
code
){
if
(
!
res
.
code
){
// 登录成功不返回code状态码。
var
body
=
res
.
body
||
res
;
var
body
=
res
.
body
||
res
;
setToken
(
body
.
token
,
rememberMe
);
setToken
(
body
.
token
,
rememberMe
);
commit
(
'
SET_TOKEN
'
,
body
.
token
);
commit
(
'
SET_TOKEN
'
,
body
.
token
);
...
@@ -42,8 +42,14 @@ const user = {
...
@@ -42,8 +42,14 @@ const user = {
// 第一次加载菜单时用到, 具体见 src 目录下的 permission.js
// 第一次加载菜单时用到, 具体见 src 目录下的 permission.js
commit
(
'
SET_LOAD_MENUS
'
,
true
);
commit
(
'
SET_LOAD_MENUS
'
,
true
);
};
resolve
(
res
)
resolve
(
res
)
}
else
{
Message
({
message
:
res
.
msg
,
type
:
'
warning
'
,
// 可以是 'success', 'warning', 'info', 'error'
});
resolve
(
null
)
}
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
reject
(
error
)
reject
(
error
)
})
})
...
...
src/views/Screen/index.vue
View file @
1b5afb1b
...
@@ -409,15 +409,16 @@ export default {
...
@@ -409,15 +409,16 @@ export default {
},
},
methods
:
{
methods
:
{
goBackendHome
(){
goBackendHome
(){
if
(
localStorage
.
getItem
(
'
groupIdByloginType
'
)
*
1
==
1
){
// 孵化器用户
// if(localStorage.getItem('groupIdByloginType')*1 == 1){ // 孵化器用户
location
.
href
=
'
/home/enterprise
'
// location.href = '/home/enterprise'
return
// return
}
// }
if
(
localStorage
.
getItem
(
'
groupIdByloginType
'
)
*
1
==
2
){
// 科技据用户
// if(localStorage.getItem('groupIdByloginType')*1 == 2){ // 科技据用户
location
.
href
=
'
/home/tech
'
// location.href = '/home/tech'
return
// return
}
// }
location
.
reload
()
// location.reload()
location
.
href
=
'
/home/enterprise
'
},
},
// 首页
// 首页
module0
(
m
,
t
,
f
,
dmIndex
,
view
){
module0
(
m
,
t
,
f
,
dmIndex
,
view
){
...
...
src/views/system/home/overview.vue
0 → 100644
View file @
1b5afb1b
This diff is collapsed.
Click to expand it.
src/views/system/user/login.vue
View file @
1b5afb1b
...
@@ -165,29 +165,35 @@ export default {
...
@@ -165,29 +165,35 @@ export default {
Cookies
.
remove
(
'
password
'
)
Cookies
.
remove
(
'
password
'
)
Cookies
.
remove
(
'
rememberMe
'
)
Cookies
.
remove
(
'
rememberMe
'
)
}
}
this
.
$store
.
dispatch
(
'
Login
'
,
user
).
then
(()
=>
{
this
.
$store
.
dispatch
(
'
Login
'
,
user
).
then
((
res
)
=>
{
this
.
loading
=
false
if
(
!
res
){
// 登录失败
if
(
this
.
userStyle
)
{
this
.
loading
=
false
if
(
this
.
userStyle
===
'
应急局
'
&&
this
.
user
.
enterpriseId
!==
0
)
{
this
.
getCode
()
this
.
$message
.
error
(
'
您是企业用户,请使用企业端登录
'
)
setTimeout
(()
=>
{
this
.
$store
.
dispatch
(
'
LogOut
'
).
then
(()
=>
{
location
.
reload
()
})
},
1000
)
return
}
if
(
this
.
userStyle
===
'
企业
'
&&
this
.
user
.
enterpriseId
===
0
)
{
this
.
$message
.
error
(
'
您是应急局用户,请使用应急局端登录
'
)
setTimeout
(()
=>
{
this
.
$store
.
dispatch
(
'
LogOut
'
).
then
(()
=>
{
location
.
reload
()
})
},
1000
)
return
}
}
}
this
.
$router
.
push
({
path
:
/* 记住上次退出时的页面 */
/* this.redirect || */
'
/home4Login
'
})
this
.
$router
.
push
({
path
:
'
/edge/Screen
'
})
// 跳转大屏
// debugger
// this.loading = false
// if (this.userStyle) {
// if (this.userStyle === '应急局' && this.user.enterpriseId !== 0) {
// this.$message.error('您是企业用户,请使用企业端登录')
// setTimeout(() => {
// this.$store.dispatch('LogOut').then(() => {
// location.reload()
// })
// }, 1000)
// return
// }
// if (this.userStyle === '企业' && this.user.enterpriseId === 0) {
// this.$message.error('您是应急局用户,请使用应急局端登录')
// setTimeout(() => {
// this.$store.dispatch('LogOut').then(() => {
// location.reload()
// })
// }, 1000)
// return
// }
// }
// this.$router.push({ path: /* 记住上次退出时的页面 */ /* this.redirect || */'/home4Login' })
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
this
.
getCode
()
this
.
getCode
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment