Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
S
shop-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
王天霸
shop-new
Commits
4a81a72f
提交
4a81a72f
authored
10月 13, 2021
作者:
王天霸
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1
上级
e52fe058
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
108 行增加
和
12 行删除
+108
-12
.env.development.rej
.env.development.rej
+1
-0
webSite.js
src/api/webSite.js
+9
-0
Navbar.vue
src/layout/components/Navbar.vue
+24
-3
user.js
src/store/modules/user.js
+20
-1
login.vue
src/views/login.vue
+23
-3
platformlogin.vue
src/views/platformlogin.vue
+31
-5
没有找到文件。
.env.development.rej
浏览文件 @
4a81a72f
...
@@ -7,3 +7,4 @@ diff a/.env.development b/.env.development (rejected hunks)
...
@@ -7,3 +7,4 @@ diff a/.env.development b/.env.development (rejected hunks)
# 路由懒加载
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
VUE_CLI_BABEL_TRANSPILE_MODULES = true
\ No newline at end of file
src/api/webSite.js
浏览文件 @
4a81a72f
...
@@ -35,3 +35,12 @@ export function getallCloudList(params) {
...
@@ -35,3 +35,12 @@ export function getallCloudList(params) {
params
params
})
})
}
}
//获取sso域名
export
function
getssoUrl
(
data
)
{
return
request
({
url
:
'//sysapi.jxhh.com/api/v1/oem/webSite/ssoChannel'
,
// url: '//192.168.26.179:6601/api/v1/oem/webSite/ssoChannel' ,
method
:
'get'
,
params
:
data
})
}
\ No newline at end of file
src/layout/components/Navbar.vue
浏览文件 @
4a81a72f
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<el-dropdown-item
@
click
.
native=
"setting = true"
>
<el-dropdown-item
@
click
.
native=
"setting = true"
>
<span>
布局设置
</span>
<span>
布局设置
</span>
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
divided
@
click
.
native=
"
logout
"
>
<el-dropdown-item
divided
@
click
.
native=
"
ssooutinfo
"
>
<span>
退出登录
</span>
<span>
退出登录
</span>
</el-dropdown-item>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
...
@@ -93,9 +93,29 @@ export default {
...
@@ -93,9 +93,29 @@ export default {
}
}
}
}
},
},
data
(){
return
{
ssourl
:
''
,
}
},
methods
:
{
methods
:
{
toggleSideBar
()
{
toggleSideBar
()
{
this
.
$store
.
dispatch
(
'app/toggleSideBar'
)
this
.
$store
.
dispatch
(
'app/toggleSideBar'
)
},
ssooutinfo
(){
var
ssa
=
window
.
location
.
host
let
data
=
{
domain
:
ssa
}
this
.
$store
.
dispatch
(
'getssourl'
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
1
){
this
.
ssourl
=
res
.
data
.
sso_url
this
.
logout
()
}
})
.
catch
(()
=>
{
})
},
},
async
logout
()
{
async
logout
()
{
this
.
$confirm
(
'确定注销并退出系统吗?'
,
'提示'
,
{
this
.
$confirm
(
'确定注销并退出系统吗?'
,
'提示'
,
{
...
@@ -105,10 +125,11 @@ export default {
...
@@ -105,10 +125,11 @@ export default {
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
$store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
this
.
$store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
var
ssa
=
window
.
location
.
host
var
ssa
=
window
.
location
.
host
var
ht
=
document
.
location
.
protocol
if
(
ssa
==
'localhost:1024'
){
if
(
ssa
==
'localhost:1024'
){
window
.
location
.
href
=
'http://sso.jxhh.com/logout?redirect=http:
//'
+
ssa
+
'/login'
window
.
location
.
href
=
ht
+
'//'
+
this
.
ssourl
+
'/logout?redirect='
+
ht
+
'
//'
+
ssa
+
'/login'
}
else
{
}
else
{
window
.
location
.
href
=
'http://sso.jxhh.com/logout?redirect=http:
//'
+
ssa
+
'/login'
window
.
location
.
href
=
ht
+
'//'
+
this
.
ssourl
+
'/logout?redirect='
+
ht
+
'
//'
+
ssa
+
'/login'
}
}
})
})
})
})
...
...
src/store/modules/user.js
浏览文件 @
4a81a72f
import
{
login
,
login2
,
logout
,
getInfo
,
getStatistics
}
from
'@/api/login'
import
{
login
,
login2
,
logout
,
getInfo
,
getStatistics
}
from
'@/api/login'
import
{
getssoUrl
}
from
'@/api/webSite'
import
{
getToken
,
setToken
,
removeToken
}
from
'@/utils/auth'
import
{
getToken
,
setToken
,
removeToken
}
from
'@/utils/auth'
const
user
=
{
const
user
=
{
...
@@ -8,10 +9,14 @@ const user = {
...
@@ -8,10 +9,14 @@ const user = {
avatar
:
''
,
avatar
:
''
,
sellerid
:
0
,
sellerid
:
0
,
roles
:
[],
roles
:
[],
permissions
:
[]
permissions
:
[],
ssourl
:
''
},
},
mutations
:
{
mutations
:
{
SET_SSOURL
:(
state
,
ssourl
)
=>
{
state
.
ssourl
=
ssourl
},
SET_TOKEN
:
(
state
,
token
)
=>
{
SET_TOKEN
:
(
state
,
token
)
=>
{
state
.
token
=
token
state
.
token
=
token
},
},
...
@@ -33,6 +38,20 @@ const user = {
...
@@ -33,6 +38,20 @@ const user = {
},
},
actions
:
{
actions
:
{
getssourl
({
commit
},
data
){
return
new
Promise
((
resolve
,
reject
)
=>
{
getssoUrl
(
data
).
then
(
response
=>
{
const
date
=
response
.
data
debugger
if
(
response
.
code
==
1
)
{
commit
(
'SET_SSOURL'
,
date
.
access_token
)
}
resolve
(
response
)
}).
catch
(
error
=>
{
reject
(
error
)
})
})
},
// 新登录
// 新登录
// oLDLogin({ commit }, userInfo) {
// oLDLogin({ commit }, userInfo) {
// const username = userInfo.username.trim()
// const username = userInfo.username.trim()
...
...
src/views/login.vue
浏览文件 @
4a81a72f
...
@@ -35,21 +35,41 @@ export default {
...
@@ -35,21 +35,41 @@ export default {
}
}
},
},
created
()
{
created
()
{
this
.
tiaozuan
();
this
.
getssourl
();
// this.getCookie();
// this.getCookie();
// this.getCode();
// this.getCode();
},
},
methods
:
{
methods
:
{
getssourl
(){
debugger
var
ssa
=
window
.
location
.
host
// var ssa = 'scm.jxhh.com'
let
data
=
{
domain
:
ssa
}
this
.
$store
.
dispatch
(
'getssourl'
,
data
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
){
this
.
ssourl
=
res
.
data
.
sso_url
this
.
tiaozuan
()
}
})
.
catch
(()
=>
{
})
},
tiaozuan
(){
tiaozuan
(){
console
.
log
(
this
.
gwToken
)
console
.
log
(
this
.
gwToken
)
if
(
this
.
gwToken
==
""
||
this
.
gwToken
==
null
){
if
(
this
.
gwToken
==
""
||
this
.
gwToken
==
null
){
var
ssa
=
window
.
location
.
host
var
ssa
=
window
.
location
.
host
var
ht
=
document
.
location
.
protocol
var
that
=
this
setTimeout
(
function
(){
setTimeout
(
function
(){
if
(
ssa
==
'localhost:1024'
){
if
(
ssa
==
'localhost:1024'
){
window
.
location
.
href
=
'http://sso.jxhh.com/login?redirect=http:
//'
+
ssa
+
'/platformlogin'
window
.
location
.
href
=
ht
+
'//'
+
that
.
ssourl
+
'/login?redirect='
+
ht
+
'
//'
+
ssa
+
'/platformlogin'
}
else
{
}
else
{
window
.
location
.
href
=
'http://sso.jxhh.com/login?redirect=http:
//'
+
ssa
+
'/platformlogin'
window
.
location
.
href
=
ht
+
'//'
+
that
.
ssourl
+
'/login?redirect='
+
ht
+
'
//'
+
ssa
+
'/platformlogin'
}
}
},
1000
)
},
1000
)
}
}
...
...
src/views/platformlogin.vue
浏览文件 @
4a81a72f
...
@@ -6,10 +6,33 @@
...
@@ -6,10 +6,33 @@
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
export
default
{
export
default
{
name
:
"Platformlogin"
,
name
:
"Platformlogin"
,
data
(){
return
{
ssourl
:
''
}
},
created
()
{
created
()
{
this
.
g
otosso
();
this
.
g
etssourl
();
},
},
methods
:
{
methods
:
{
getssourl
(){
debugger
var
ssa
=
window
.
location
.
host
// var ssa = 'scm.jxhh.com'
let
data
=
{
domain
:
ssa
}
this
.
$store
.
dispatch
(
'getssourl'
,
data
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
){
this
.
ssourl
=
res
.
data
.
sso_url
this
.
gotosso
()
}
})
.
catch
(()
=>
{
})
},
gotosso
()
{
gotosso
()
{
var
ticket
=
this
.
$route
.
query
.
ticket
;
var
ticket
=
this
.
$route
.
query
.
ticket
;
this
.
$store
.
dispatch
(
'Login'
,
{
"ticket"
:
ticket
}).
then
((
res
)
=>
{
this
.
$store
.
dispatch
(
'Login'
,
{
"ticket"
:
ticket
}).
then
((
res
)
=>
{
...
@@ -66,11 +89,13 @@
...
@@ -66,11 +89,13 @@
this
.
$store
.
dispatch
(
'Statistic'
)
this
.
$store
.
dispatch
(
'Statistic'
)
this
.
$store
.
dispatch
(
'FedLogOut'
)
this
.
$store
.
dispatch
(
'FedLogOut'
)
var
ssa
=
window
.
location
.
host
;
var
ssa
=
window
.
location
.
host
;
var
ht
=
document
.
location
.
protocol
let
that
=
this
setTimeout
(
function
()
{
setTimeout
(
function
()
{
if
(
ssa
==
'localhost:1024'
)
{
if
(
ssa
==
'localhost:1024'
)
{
window
.
location
.
href
=
'http://sso.jxhh.com/logout?redirect=http:
//'
+
ssa
+
'/login'
window
.
location
.
href
=
ht
+
'//'
+
that
.
ssourl
+
'/logout?redirect='
+
ht
+
'
//'
+
ssa
+
'/login'
}
else
{
}
else
{
window
.
location
.
href
=
'http://sso.jxhh.com/logout?redirect=http:
//'
+
ssa
+
'/login'
window
.
location
.
href
=
ht
+
'//'
+
that
.
ssourl
+
'/logout?redirect='
+
ht
+
'
//'
+
ssa
+
'/login'
}
}
},
1000
)
},
1000
)
}
}
...
@@ -79,11 +104,12 @@
...
@@ -79,11 +104,12 @@
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
$store
.
dispatch
(
'FedLogOut'
)
this
.
$store
.
dispatch
(
'FedLogOut'
)
var
ssa
=
window
.
location
.
host
var
ssa
=
window
.
location
.
host
var
ht
=
document
.
location
.
protocol
setTimeout
(
function
()
{
setTimeout
(
function
()
{
if
(
ssa
==
'localhost:1024'
)
{
if
(
ssa
==
'localhost:1024'
)
{
window
.
location
.
href
=
'http://sso.jxhh.com/logout?redirect=http:
//'
+
ssa
+
'/login'
window
.
location
.
href
=
ht
+
'//'
+
that
.
ssourl
+
'/logout?redirect='
+
ht
+
'
//'
+
ssa
+
'/login'
}
else
{
}
else
{
window
.
location
.
href
=
'http://sso.jxhh.com/logout?redirect=http:
//'
+
ssa
+
'/login'
window
.
location
.
href
=
ht
+
'//'
+
that
.
ssourl
+
'/logout?redirect='
+
ht
+
'
//'
+
ssa
+
'/login'
}
}
},
1000
)
},
1000
)
this
.
loading
=
false
this
.
loading
=
false
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论