Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
folacin-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
ynby
folacin-front
Commits
1feefd56
Commit
1feefd56
authored
Feb 19, 2025
by
罗成兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取用户信息
parent
2c26227e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
index.vue
folacin-app/src/views/index/index.vue
+20
-19
No files found.
folacin-app/src/views/index/index.vue
View file @
1feefd56
...
...
@@ -29,6 +29,17 @@ export default {
return
{
msg
:
null
,
scrollPosition
:
0
,
userInfo
:
{
account
:
null
,
token
:
"52d30e396dff44eca2f51f614e42a8c0"
,
userId
:
null
,
residentId
:
null
,
nickName
:
null
,
realName
:
null
,
gender
:
null
,
headPortrait
:
null
,
domain
:
window
.
location
.
href
}
}
},
created
()
{
...
...
@@ -39,7 +50,8 @@ export default {
if
(
path
!=
'/'
)
{
return
;
}
vm
.
getUserByToken
(
result
,
false
);
this
.
userInfo
.
token
=
result
.
token
;
vm
.
getUserByToken
(
this
.
userInfo
,
false
);
};
},
mounted
()
{
...
...
@@ -50,29 +62,18 @@ export default {
},
methods
:
{
init
()
{
let
userInfo
=
{
account
:
null
,
token
:
"349eb2231a36490e88bbbe34eb330a5c"
,
userId
:
null
,
residentId
:
null
,
nickName
:
null
,
realName
:
null
,
gender
:
null
,
headPortrait
:
null
,
domain
:
window
.
location
.
href
};
if
(
process
.
env
.
NODE_ENV
==
"dev1"
)
{
this
.
initUserInfo
(
userInfo
,
true
);
this
.
getUserByToken
(
userInfo
,
true
);
if
(
process
.
env
.
NODE_ENV
==
"dev"
)
{
this
.
initUserInfo
(
this
.
userInfo
,
true
);
this
.
getUserByToken
(
this
.
userInfo
,
true
);
}
else
{
let
query
=
this
.
$route
.
query
;
userInfo
.
token
=
query
.
token
this
.
initUserInfo
(
userInfo
,
true
);
if
(
!
userInfo
.
token
)
{
this
.
userInfo
.
token
=
query
.
token
this
.
initUserInfo
(
this
.
userInfo
,
true
);
if
(
!
this
.
userInfo
.
token
)
{
this
.
msg
=
"获取用户信息异常!"
callMobile
(
'init'
,
{});
}
else
{
this
.
getUserByToken
(
userInfo
,
true
)
this
.
getUserByToken
(
this
.
userInfo
,
true
)
}
}
},
...
...
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