Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
digital-construction
Project
Project
Details
Activity
Releases
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
张牧越
digital-construction
Commits
563dfdf0
Commit
563dfdf0
authored
Apr 17, 2023
by
张牧越
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏跳转登录
parent
b9f395ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
19 deletions
+27
-19
App.vue
src/App.vue
+24
-3
Index.vue
src/components/Index.vue
+2
-15
request.js
src/utils/request.js
+1
-1
No files found.
src/App.vue
View file @
563dfdf0
<
template
>
<div
id=
"app"
>
<router-view></router-view>
<router-view
v-if=
"signIn"
></router-view>
</div>
</
template
>
<
script
>
import
{
getXAccessToken
}
from
"@/api/index"
;
export
default
{
name
:
"App"
,
components
:
{},
methods
:
{},
mounted
()
{
data
()
{
return
{
signIn
:
false
,
};
},
methods
:
{
getXAccessToken
()
{
getXAccessToken
(
localStorage
.
getItem
(
"token"
)).
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
{
localStorage
.
setItem
(
"Authorization"
,
res
.
data
.
access_token
);
this
.
$nextTick
(()
=>
{
this
.
signIn
=
true
;
});
}
});
},
},
beforeCreate
()
{
console
.
log
(
this
.
$route
);
if
(
this
.
$route
.
query
.
token_code
)
{
localStorage
.
setItem
(
"token"
,
this
.
$route
.
query
.
token_code
);
}
},
mounted
()
{
this
.
getXAccessToken
();
},
};
</
script
>
...
...
src/components/Index.vue
View file @
563dfdf0
...
...
@@ -5,7 +5,7 @@
<span
style=
"font-size: 14px; cursor: pointer"
@
click=
"jumpBack"
>
工程项目后台管理系统
</span
>
<router-link
:to=
"
{ path: '/', query: { token: token } }" exact
<router-link
:to=
"
{ path: '/', query: { token
_code
: token } }" exact
>数字工地
</router-link
>
<router-link
to=
"/realname"
>
实名制
</router-link>
...
...
@@ -29,13 +29,12 @@
</div>
</div>
</div>
<div
v-if=
"signIn"
>
<div>
<router-view></router-view>
</div>
</div>
</
template
>
<
script
>
import
{
getXAccessToken
}
from
"@/api/index"
;
export
default
{
name
:
"Index"
,
data
()
{
...
...
@@ -44,7 +43,6 @@ export default {
weekDay
:
""
,
date
:
""
,
zoom
:
1
,
signIn
:
false
,
};
},
methods
:
{
...
...
@@ -103,16 +101,6 @@ export default {
jumpBack
()
{
window
.
location
.
href
=
window
.
location
.
origin
+
"/pweb/m/"
;
},
getXAccessToken
()
{
getXAccessToken
(
localStorage
.
getItem
(
"token"
)).
then
((
res
)
=>
{
if
(
res
.
status
==
200
)
{
localStorage
.
setItem
(
"Authorization"
,
res
.
data
.
access_token
);
this
.
$nextTick
(()
=>
{
this
.
signIn
=
true
;
});
}
});
},
},
computed
:
{
token
()
{
...
...
@@ -122,7 +110,6 @@ export default {
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
bodyScale
();
this
.
getXAccessToken
();
});
this
.
getTime
();
...
...
src/utils/request.js
View file @
563dfdf0
...
...
@@ -64,7 +64,7 @@ request.interceptors.response.use(
})
}
if
(
response
.
data
.
status
==
401
)
{
window
.
location
.
href
=
process
.
env
.
VUE_APP_RESOURCE_URL
+
'pweb/m/login'
window
.
location
.
href
=
process
.
env
.
VUE_APP_RESOURCE_URL
+
'pweb/m/login
?is_screen=1
'
}
return
response
.
data
},
...
...
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