Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
refined-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
refined-platform
Commits
6fc8965b
Commit
6fc8965b
authored
Apr 13, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加海康部分接口实现类
parent
b609db8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
60 deletions
+19
-60
refined-manager-ui/admin/src/views/SSO.vue
refined-manager-ui/admin/src/views/SSO.vue
+19
-60
No files found.
refined-manager-ui/admin/src/views/SSO.vue
View file @
6fc8965b
...
@@ -5,70 +5,29 @@
...
@@ -5,70 +5,29 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
jwt_decode
from
"
jwt-decode
"
;
export
default
{
export
default
{
name
:
'
sso
'
,
created
()
{
},
mounted
()
{
mounted
()
{
let
token
=
this
.
$route
.
query
.
token
let
token
=
this
.
$route
.
query
.
token
;
console
.
log
(
"
token:
"
+
token
)
let
siteid
=
this
.
$route
.
query
.
siteid
;
console
.
log
(
"
解析后的token:
"
,
jwt_decode
(
token
))
if
(
token
)
{
//const decode = jwt_decode(data.normal_login_token).accountId; // 解析
window
.
sessionStorage
.
setItem
(
"
token
"
,
token
);
if
(
token
)
{
window
.
sessionStorage
.
setItem
(
"
siteid
"
,
siteid
);
//本地登录后跳转
this
.
$router
.
push
(
"
/index
"
);
// 有token直接跳转首页
this
.
form
.
loginName
=
jwt_decode
(
token
).
userInfo
.
account
}
else
{
this
.
form
.
password
=
jwt_decode
(
token
).
userInfo
.
password
/* this.form.loginName="admin"
this.form.password="scsmile"*/
this
.
login
()
//window.sessionStorage.setItem("token", token);
// this.$router.push('/index') // 有token直接跳转首页
}
else
{
this
.
$message
({
this
.
$message
({
message
:
'
没有权限,正在跳转登录页面...
'
,
message
:
"
没有权限,正在跳转登录页面...
"
,
center
:
true
center
:
true
,
});
});
setTimeout
(
function
(){
setTimeout
(
function
()
{
window
.
location
.
href
=
process
.
env
.
VUE_APP_PORTAL_URL
==
'
undefined
'
?
'
http://192.168.0.98:11072
'
:
process
.
env
.
VUE_APP_PORTAL_URL
window
.
location
.
href
=
//this.$router.push('/login')
process
.
env
.
VUE_APP_PORTAL_URL
==
"
undefined
"
},
1000
)
?
"
http://192.168.0.98:11072
"
:
process
.
env
.
VUE_APP_PORTAL_URL
;
//this.$router.push('/login')
},
1000
);
}
}
},
},
methods
:
{
};
login
()
{
this
.
loading
=
true
;
this
.
$post
(
"
/login/login
"
,
this
.
form
)
.
then
(
this
.
loginSuccess
)
.
catch
(
this
.
loginFail
);
},
loginSuccess
({
data
})
{
console
.
log
(
"
userData
"
,
data
);
this
.
$store
.
commit
(
"
setUserData
"
,
data
);
this
.
$router
.
push
(
'
/index
'
)
// 有token直接跳转首页
/* this.$router.replace({
path: this.redirect,
});*/
},
loginFail
(
error
)
{
this
.
loading
=
false
;
this
.
$message
.
error
(
error
.
message
);
},
},
data
()
{
return
{
form
:
{
loginName
:
''
,
password
:
''
,
securityCode
:
''
,
},
redirect
:
this
.
$route
.
query
.
redirect
,
loading
:
true
,
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
...
@@ -76,4 +35,4 @@ export default {
...
@@ -76,4 +35,4 @@ export default {
width
:
300px
;
width
:
300px
;
height
:
100px
;
height
:
100px
;
}
}
</
style
>
</
style
>
\ No newline at end of file
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