Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
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
Administrator
dsk-cr20g
Commits
7daeddb5
Commit
7daeddb5
authored
Aug 25, 2023
by
huangjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导航
parent
bb709a4b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
6 deletions
+33
-6
login.js
dsk-operate-ui/src/api/login.js
+8
-0
Navbar.vue
dsk-operate-ui/src/layout/components/Navbar.vue
+23
-6
login.vue
dsk-operate-ui/src/views/login.vue
+1
-0
index.vue
dsk-operate-ui/src/views/system/user/index.vue
+1
-0
No files found.
dsk-operate-ui/src/api/login.js
View file @
7daeddb5
...
@@ -65,3 +65,11 @@ export function getTenants(data) {
...
@@ -65,3 +65,11 @@ export function getTenants(data) {
method
:
'post'
,
method
:
'post'
,
})
})
}
}
//
// 切换租户
export
function
changeTenants
(
data
)
{
return
request
({
url
:
'/switch/tenant?tenantId='
+
data
,
method
:
'post'
,
})
}
dsk-operate-ui/src/layout/components/Navbar.vue
View file @
7daeddb5
...
@@ -16,12 +16,11 @@
...
@@ -16,12 +16,11 @@
<el-dropdown-menu
slot=
"dropdown"
class=
"user-dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
class=
"user-dropdown"
>
<el-dropdown-item>
<el-dropdown-item>
<span>
我的企业
<img
class=
"dir"
src=
"@/assets/images/direction.png"
>
</span>
<span>
我的企业
<img
class=
"dir"
src=
"@/assets/images/direction.png"
>
</span>
<div
class=
"mycom"
>
<div
class=
"mycom"
v-if=
"tenanlist.length>1"
>
<div
class=
"bg"
>
<div
class=
"bg"
>
<div
@
click=
"getorther"
class=
"choose"
><img
src=
"@/assets/images/enter.png"
class=
"logos"
><span>
重庆大司空科技
</span><img
class=
"on"
src=
"@/assets/images/tips.png"
></div>
<div
@
click=
"getorther(item.tenantId)"
v-for=
"(item,index) in tenanlist"
:class=
"
{'choose':tenantId == item.tenantId}">
<div
@
click=
"getorther"
><img
src=
"@/assets/images/enter.png"
class=
"logos"
><span>
重庆大司空科技重庆大司空科技重庆大司空科技重庆大司空科技
</span><img
class=
"on"
src=
"@/assets/images/tips.png"
></div>
<img
src=
"@/assets/images/enter.png"
class=
"logos"
><span>
{{
item
.
companyName
}}
</span><img
class=
"on"
src=
"@/assets/images/tips.png"
>
<div
@
click=
"getorther"
><img
src=
"@/assets/images/enter.png"
class=
"logos"
><span>
重庆大司空科技
</span><img
class=
"on"
src=
"@/assets/images/tips.png"
></div>
</div>
<div
@
click=
"getorther"
><img
src=
"@/assets/images/enter.png"
class=
"logos"
><span>
重庆大司空科技
</span><img
class=
"on"
src=
"@/assets/images/tips.png"
></div>
</div>
</div>
</div>
</div>
</el-dropdown-item>
</el-dropdown-item>
...
@@ -43,6 +42,8 @@
...
@@ -43,6 +42,8 @@
import
{
mapGetters
}
from
'vuex'
import
{
mapGetters
}
from
'vuex'
import
elementResizeDetectorMaker
from
"element-resize-detector"
import
elementResizeDetectorMaker
from
"element-resize-detector"
import
TagsView
from
'./TagsView'
import
TagsView
from
'./TagsView'
import
{
getTenants
,
changeTenants
}
from
"@/api/login"
;
import
{
getTenantid
,
setTenantid
,
setToken
}
from
'@/utils/auth'
export
default
{
export
default
{
props
:[
'offsetWidth'
],
props
:[
'offsetWidth'
],
components
:
{
components
:
{
...
@@ -50,6 +51,8 @@ export default {
...
@@ -50,6 +51,8 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
tenantId
:
-
1
,
tenanlist
:[],
scrollerWidth
:
null
,
scrollerWidth
:
null
,
navbarWidth
:
null
navbarWidth
:
null
}
}
...
@@ -77,8 +80,18 @@ export default {
...
@@ -77,8 +80,18 @@ export default {
})
})
this
.
navbarWidth
=
`calc(100% -
${
this
.
offsetWidth
}
px)`
this
.
navbarWidth
=
`calc(100% -
${
this
.
offsetWidth
}
px)`
// this.$refs.mydrodown.show()
// this.$refs.mydrodown.show()
this
.
getTetant
()
},
},
methods
:
{
methods
:
{
getTetant
(){
this
.
tenantId
=
getTenantid
()
// getTenants(localStorage.getItem('userphone')).then(res=>{
getTenants
(
'15823584612'
).
then
(
res
=>
{
if
(
res
.
code
==
200
){
this
.
tenanlist
=
res
.
data
}
})
},
async
logout
()
{
async
logout
()
{
this
.
$confirm
(
'确定退出系统吗?'
,
'提示'
,
{
this
.
$confirm
(
'确定退出系统吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
...
@@ -90,7 +103,11 @@ export default {
...
@@ -90,7 +103,11 @@ export default {
})
})
}).
catch
(()
=>
{});
}).
catch
(()
=>
{});
},
},
getorther
(){
getorther
(
id
){
setTenantid
(
id
)
changeTenants
(
id
).
then
(
res
=>
{
setToken
(
res
.
data
.
accessToken
)
})
location
.
reload
();
location
.
reload
();
this
.
$router
.
push
({
path
:
this
.
redirect
||
"/"
}).
catch
(()
=>
{});
this
.
$router
.
push
({
path
:
this
.
redirect
||
"/"
}).
catch
(()
=>
{});
}
}
...
...
dsk-operate-ui/src/views/login.vue
View file @
7daeddb5
...
@@ -154,6 +154,7 @@ export default {
...
@@ -154,6 +154,7 @@ export default {
Cookies
.
remove
(
'rememberMe'
);
Cookies
.
remove
(
'rememberMe'
);
}
}
this
.
$store
.
dispatch
(
"Login"
,
this
.
loginForm
).
then
(()
=>
{
this
.
$store
.
dispatch
(
"Login"
,
this
.
loginForm
).
then
(()
=>
{
localStorage
.
setItem
(
'userphone'
,
this
.
loginForm
.
username
)
this
.
goin
()
this
.
goin
()
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
...
...
dsk-operate-ui/src/views/system/user/index.vue
View file @
7daeddb5
...
@@ -444,6 +444,7 @@ export default {
...
@@ -444,6 +444,7 @@ export default {
}
}
],
],
phonenumber
:
[
phonenumber
:
[
{
required
:
true
,
message
:
"手机号码不能为空"
,
trigger
:
"blur"
},
{
{
pattern
:
/^1
[
3|4|5|6|7|8|9
][
0-9
]\d{8}
$/
,
pattern
:
/^1
[
3|4|5|6|7|8|9
][
0-9
]\d{8}
$/
,
message
:
"请输入正确的手机号码"
,
message
:
"请输入正确的手机号码"
,
...
...
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