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
2dcc8b96
Commit
2dcc8b96
authored
Feb 18, 2025
by
罗成兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户id获取
parent
7959da1d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
index.vue
folacin-app/src/views/index/index.vue
+6
-6
No files found.
folacin-app/src/views/index/index.vue
View file @
2dcc8b96
...
@@ -50,14 +50,14 @@ export default {
...
@@ -50,14 +50,14 @@ export default {
},
},
methods
:
{
methods
:
{
init
()
{
init
()
{
if
(
process
.
env
.
NODE_ENV
==
"dev
1
"
)
{
if
(
process
.
env
.
NODE_ENV
==
"dev"
)
{
let
userInfo
=
{
let
userInfo
=
{
account
:
'18487125843'
,
account
:
'18487125843'
,
token
:
'd2e2c11475a04436bbcf1ca96a7ee056'
,
token
:
'd2e2c11475a04436bbcf1ca96a7ee056'
,
userId
:
null
,
userId
:
null
,
domain
:
window
.
location
.
href
domain
:
window
.
location
.
href
};
};
this
.
initUserInfo
(
userInfo
);
this
.
initUserInfo
(
userInfo
,
true
);
this
.
getUserByToken
(
userInfo
);
this
.
getUserByToken
(
userInfo
);
}
else
{
}
else
{
let
query
=
this
.
$route
.
query
;
let
query
=
this
.
$route
.
query
;
...
@@ -67,7 +67,7 @@ export default {
...
@@ -67,7 +67,7 @@ export default {
userId
:
null
,
userId
:
null
,
domain
:
window
.
location
.
href
domain
:
window
.
location
.
href
};
};
this
.
initUserInfo
(
userInfo
);
this
.
initUserInfo
(
userInfo
,
true
);
if
(
!
userInfo
.
token
&&
!
userInfo
.
account
)
{
if
(
!
userInfo
.
token
&&
!
userInfo
.
account
)
{
this
.
msg
=
"用户信息获取失败!"
this
.
msg
=
"用户信息获取失败!"
callMobile
(
'init'
,
{});
callMobile
(
'init'
,
{});
...
@@ -88,7 +88,7 @@ export default {
...
@@ -88,7 +88,7 @@ export default {
getUserByToken
(
userInfo
.
token
).
then
(
res
=>
{
getUserByToken
(
userInfo
.
token
).
then
(
res
=>
{
if
(
res
.
code
==
'SUCCESS'
)
{
if
(
res
.
code
==
'SUCCESS'
)
{
userInfo
.
userId
=
res
.
data
userInfo
.
userId
=
res
.
data
this
.
initUserInfo
(
userInfo
)
this
.
initUserInfo
(
userInfo
,
false
);
this
.
showMsg
();
this
.
showMsg
();
}
else
{
}
else
{
this
.
msg
=
"用户id获取失败!"
this
.
msg
=
"用户id获取失败!"
...
@@ -98,8 +98,8 @@ export default {
...
@@ -98,8 +98,8 @@ export default {
handleBack
()
{
handleBack
()
{
callMobile
(
'goIndex'
,
{});
callMobile
(
'goIndex'
,
{});
},
},
initUserInfo
(
val
)
{
initUserInfo
(
val
,
isPc
)
{
if
(
process
.
env
.
NODE_ENV
==
"dev"
)
{
if
(
isPc
)
{
window
.
sessionStorage
.
setItem
(
'userInfo'
,
JSON
.
stringify
(
val
));
window
.
sessionStorage
.
setItem
(
'userInfo'
,
JSON
.
stringify
(
val
));
return
;
return
;
}
}
...
...
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