Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
platform
/
fanxing_new
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ad552bac
authored
Feb 13, 2020
by
潘建波
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交login
1 parent
64cfe7f1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
7 deletions
src/views/Login.vue
src/views/Login.vue
View file @
ad552ba
...
...
@@ -50,15 +50,12 @@ import types from '../store/types.js'
"user_type"
:
"user"
}).
then
(
res
=>
{
if
(
!
res
.
ecode
){
this
.
$store
.
commit
(
types
.
ATOKEN
,
res
.
token
);
this
.
$store
.
commit
(
types
.
ATOKEN
,
res
.
a
token
);
// localStorage.setItem('rtoken',m.data.rtoken)
// localStorage.setItem('user_unid',m.data.role_unid)
// localStorage.setItem('uid',m.data.unid)
localStorage
.
setItem
(
'menu'
,
JSON
.
stringify
(
res
.
menu_list
))
sessionStorage
.
setItem
(
'user_unid'
,
res
.
user_unid
)
//本系统可以直接用本地缓存做
this
.
$store
.
dispatch
(
'GetMenuRole'
,
res
.
menu_list
).
then
(
res
=>
{
this
.
$router
.
push
(
'/'
)
})
//获
this
.
getMenu
(
res
.
user_unid
)
// localStorage.setItem('user_name',this.username)
// 处理登录用户权限菜单显示问题;
//算法配置列表
...
...
@@ -67,7 +64,9 @@ import types from '../store/types.js'
this
.
storeConfList
();
//code列表
this
.
getCodeList
();
this
.
getCustomCode
();
this
.
getEventList
();
this
.
getDev
();
}
}).
catch
((
err
)
=>
{
...
...
@@ -123,6 +122,22 @@ import types from '../store/types.js'
}).
catch
((
err
)
=>
{
})
},
getCustomCode
(){
this
.
$api
.
login
.
customCode
().
then
(
res
=>
{
if
(
res
.
list_data
.
length
>
0
)
{
res
.
list_data
.
forEach
((
item
)
=>
{
window
.
localStorage
.
setItem
(
item
.
name
+
'-'
+
item
.
cate
,
item
.
unid
);
})
}
else
{
this
.
$message
({
type
:
'warning'
,
message
:
'获取自定义编码失败!'
})
}
}).
catch
((
err
)
=>
{
})
},
getEventList
(){
this
.
$api
.
search
.
eventTypes
({}).
then
(
res
=>
{
// 存储code列表
...
...
@@ -133,6 +148,11 @@ import types from '../store/types.js'
})
})
},
getDev
()
{
this
.
$api
.
resource
.
devs
().
then
(
res
=>
{
sessionStorage
.
setItem
(
'dev_unid'
,
res
[
0
].
dev_unid
)
})
},
},
watch
:
{},
mounted
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment