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
bb709a4b
Commit
bb709a4b
authored
Aug 25, 2023
by
huangjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导航
parent
1ed7159b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
140 additions
and
30 deletions
+140
-30
login.js
dsk-operate-ui/src/api/login.js
+9
-1
user.js
dsk-operate-ui/src/store/modules/user.js
+5
-0
auth.js
dsk-operate-ui/src/utils/auth.js
+11
-0
request.js
dsk-operate-ui/src/utils/request.js
+6
-1
login.vue
dsk-operate-ui/src/views/login.vue
+23
-14
index.vue
dsk-operate-ui/src/views/system/dept/index.vue
+79
-6
index.vue
dsk-operate-ui/src/views/system/role/index.vue
+5
-7
vue.config.js
dsk-operate-ui/vue.config.js
+2
-1
No files found.
dsk-operate-ui/src/api/login.js
View file @
bb709a4b
...
@@ -56,4 +56,12 @@ export function getCodeImg() {
...
@@ -56,4 +56,12 @@ export function getCodeImg() {
method
:
'get'
,
method
:
'get'
,
timeout
:
20000
timeout
:
20000
})
})
}
}
\ No newline at end of file
//获取租户企业列表
export
function
getTenants
(
data
)
{
return
request
({
url
:
'/user/tenants?userName='
+
data
,
method
:
'post'
,
})
}
dsk-operate-ui/src/store/modules/user.js
View file @
bb709a4b
...
@@ -9,6 +9,7 @@ const user = {
...
@@ -9,6 +9,7 @@ const user = {
roles
:
[],
roles
:
[],
permissions
:
[],
permissions
:
[],
userId
:
''
,
userId
:
''
,
phonenumber
:
''
,
},
},
mutations
:
{
mutations
:
{
...
@@ -29,6 +30,9 @@ const user = {
...
@@ -29,6 +30,9 @@ const user = {
},
},
SET_USERID
:
(
state
,
userId
)
=>
{
SET_USERID
:
(
state
,
userId
)
=>
{
state
.
userId
=
userId
state
.
userId
=
userId
},
SET_USERPHONE
:
(
state
,
phonenumber
)
=>
{
state
.
phonenumber
=
phonenumber
}
}
},
},
...
@@ -65,6 +69,7 @@ const user = {
...
@@ -65,6 +69,7 @@ const user = {
commit
(
'SET_NAME'
,
user
.
nickName
)
commit
(
'SET_NAME'
,
user
.
nickName
)
commit
(
'SET_AVATAR'
,
avatar
)
commit
(
'SET_AVATAR'
,
avatar
)
commit
(
'SET_USERID'
,
user
.
userId
)
commit
(
'SET_USERID'
,
user
.
userId
)
commit
(
'SET_USERPHONE'
,
user
.
phonenumber
)
resolve
(
res
)
resolve
(
res
)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
reject
(
error
)
reject
(
error
)
...
...
dsk-operate-ui/src/utils/auth.js
View file @
bb709a4b
import
Cookies
from
'js-cookie'
import
Cookies
from
'js-cookie'
const
TokenKey
=
'Admin-Token'
const
TokenKey
=
'Admin-Token'
const
Tenantid
=
'Tenant-Id'
export
function
getToken
()
{
export
function
getToken
()
{
return
Cookies
.
get
(
TokenKey
)
return
Cookies
.
get
(
TokenKey
)
}
}
export
function
getTenantid
()
{
return
Cookies
.
get
(
Tenantid
)
}
export
function
setToken
(
token
)
{
export
function
setToken
(
token
)
{
return
Cookies
.
set
(
TokenKey
,
token
)
return
Cookies
.
set
(
TokenKey
,
token
)
}
}
export
function
setTenantid
(
id
)
{
return
Cookies
.
set
(
Tenantid
,
id
)
}
export
function
removeToken
()
{
export
function
removeToken
()
{
return
Cookies
.
remove
(
TokenKey
)
return
Cookies
.
remove
(
TokenKey
)
}
}
export
function
removeTenantid
()
{
return
Cookies
.
remove
(
Tenantid
)
}
dsk-operate-ui/src/utils/request.js
View file @
bb709a4b
import
axios
from
'axios'
import
axios
from
'axios'
import
{
Notification
,
MessageBox
,
Message
,
Loading
}
from
'element-ui'
import
{
Notification
,
MessageBox
,
Message
,
Loading
}
from
'element-ui'
import
store
from
'@/store'
import
store
from
'@/store'
import
{
getToken
}
from
'@/utils/auth'
import
{
getToken
,
getTenantid
}
from
'@/utils/auth'
import
errorCode
from
'@/utils/errorCode'
import
errorCode
from
'@/utils/errorCode'
import
{
tansParams
,
blobValidate
}
from
"@/utils/ruoyi"
;
import
{
tansParams
,
blobValidate
}
from
"@/utils/ruoyi"
;
import
cache
from
'@/plugins/cache'
import
cache
from
'@/plugins/cache'
...
@@ -28,6 +28,7 @@ service.interceptors.request.use(config => {
...
@@ -28,6 +28,7 @@ service.interceptors.request.use(config => {
const
isRepeatSubmit
=
(
config
.
headers
||
{}).
repeatSubmit
===
false
const
isRepeatSubmit
=
(
config
.
headers
||
{}).
repeatSubmit
===
false
if
(
getToken
()
&&
!
isToken
)
{
if
(
getToken
()
&&
!
isToken
)
{
config
.
headers
[
'Authorization'
]
=
'Bearer '
+
getToken
()
// 让每个请求携带自定义token 请根据实际情况自行修改
config
.
headers
[
'Authorization'
]
=
'Bearer '
+
getToken
()
// 让每个请求携带自定义token 请根据实际情况自行修改
config
.
headers
[
'tenantid'
]
=
getTenantid
()
//携带租户id
}
}
// get请求映射params参数
// get请求映射params参数
if
(
config
.
method
===
'get'
&&
config
.
params
)
{
if
(
config
.
method
===
'get'
&&
config
.
params
)
{
...
@@ -118,8 +119,12 @@ service.interceptors.response.use(res => {
...
@@ -118,8 +119,12 @@ service.interceptors.response.use(res => {
}
else
{
}
else
{
Message
({
message
:
message
,
type
:
'error'
,
duration
:
5
*
1000
})
Message
({
message
:
message
,
type
:
'error'
,
duration
:
5
*
1000
})
}
}
if
(
error
.
message
.
indexOf
(
'timeout'
)
<
0
){
//超时报错不提示
return
Promise
.
reject
(
error
)
return
Promise
.
reject
(
error
)
}
}
// return Promise.reject(error)
}
)
)
// 通用下载方法
// 通用下载方法
...
...
dsk-operate-ui/src/views/login.vue
View file @
bb709a4b
...
@@ -62,30 +62,25 @@
...
@@ -62,30 +62,25 @@
<div
v-if=
"islog"
class=
"login-form choose-form"
>
<div
v-if=
"islog"
class=
"login-form choose-form"
>
<h3
class=
"title i"
><img
src=
"../assets/images/login/title_choose.png"
/>
请选择你想要登录的企业
</h3>
<h3
class=
"title i"
><img
src=
"../assets/images/login/title_choose.png"
/>
请选择你想要登录的企业
</h3>
<div
class=
"enterpriselist"
>
<div
class=
"enterpriselist"
>
<div
class=
"entername"
>
<el-radio
v-model=
"radio"
label=
"1"
>
中国华西工程设计建设有限公司中国华西工程设计建设有限公司中国华西工程设计建设有限公司
</el-radio></div>
<div
class=
"entername"
v-for=
"(item,index) of tenanlist"
>
<el-radio
v-model=
"tenantId"
:label=
"item.tenantId"
>
{{
item
.
companyName
}}
</el-radio></div>
<div
class=
"entername"
>
<el-radio
v-model=
"radio"
label=
"2"
>
中国华西工程设计建设有限公司中国华西工程设计建设有限公司中国华西工程设计建设有限公司
</el-radio></div>
<div
class=
"entername"
>
<el-radio
v-model=
"radio"
label=
"3"
>
中国华西工程设计建设有限公司中国华西工程设计建设有限公司中国华西工程设计建设有限公司
</el-radio></div>
<div
class=
"entername"
>
<el-radio
v-model=
"radio"
label=
"4"
>
中国华西工程设计建设有限公司中国华西工程设计建设有限公司中国华西工程设计建设有限公司
</el-radio></div>
<div
class=
"entername"
>
<el-radio
v-model=
"radio"
label=
"5"
>
中国华西工程设计建设有限公司中国华西工程设计建设有限公司中国华西工程设计建设有限公司
</el-radio></div>
<div
class=
"entername"
>
<el-radio
v-model=
"radio"
label=
"6"
>
中国华西工程设计建设有限公司中国华西工程设计建设有限公司中国华西工程设计建设有限公司
</el-radio></div>
<div
class=
"entername"
>
<el-radio
v-model=
"radio"
label=
"7"
>
中国华西工程设计建设有限公司中国华西工程设计建设有限公司中国华西工程设计建设有限公司
</el-radio></div>
</div>
</div>
<el-button
class=
"goin"
type=
"primary"
:disabled=
"
radio == -1"
@
click=
"goin
"
>
立即进入
</el-button>
<el-button
class=
"goin"
type=
"primary"
:disabled=
"
tenantId == -1"
@
click=
"tochose
"
>
立即进入
</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getCodeImg
}
from
"@/api/login"
;
import
{
getCodeImg
,
getTenants
}
from
"@/api/login"
;
import
Cookies
from
"js-cookie"
;
import
Cookies
from
"js-cookie"
;
import
{
encrypt
,
decrypt
}
from
'@/utils/jsencrypt'
import
{
encrypt
,
decrypt
}
from
'@/utils/jsencrypt'
import
{
setTenantid
}
from
'@/utils/auth'
export
default
{
export
default
{
name
:
"Login"
,
name
:
"Login"
,
data
()
{
data
()
{
return
{
return
{
radio
:
-
1
,
tenantId
:
-
1
,
islog
:
false
,
islog
:
false
,
codeUrl
:
""
,
codeUrl
:
""
,
loginForm
:
{
loginForm
:
{
...
@@ -109,7 +104,8 @@ export default {
...
@@ -109,7 +104,8 @@ export default {
captchaEnabled
:
true
,
captchaEnabled
:
true
,
// 注册开关
// 注册开关
register
:
false
,
register
:
false
,
redirect
:
undefined
redirect
:
undefined
,
tenanlist
:[],
};
};
},
},
watch
:
{
watch
:
{
...
@@ -158,9 +154,7 @@ export default {
...
@@ -158,9 +154,7 @@ export default {
Cookies
.
remove
(
'rememberMe'
);
Cookies
.
remove
(
'rememberMe'
);
}
}
this
.
$store
.
dispatch
(
"Login"
,
this
.
loginForm
).
then
(()
=>
{
this
.
$store
.
dispatch
(
"Login"
,
this
.
loginForm
).
then
(()
=>
{
this
.
islog
=
true
this
.
goin
()
this
.
goin
()
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
if
(
this
.
captchaEnabled
)
{
if
(
this
.
captchaEnabled
)
{
...
@@ -171,8 +165,23 @@ export default {
...
@@ -171,8 +165,23 @@ export default {
});
});
},
},
goin
(){
goin
(){
this
.
tenantId
=
-
1
getTenants
(
this
.
loginForm
.
username
).
then
(
res
=>
{
if
(
res
.
code
==
200
){
this
.
tenanlist
=
res
.
data
if
(
this
.
tenanlist
.
length
>
1
){
this
.
islog
=
true
}
else
{
setTenantid
(
this
.
tenanlist
[
0
].
tenantId
)
this
.
$router
.
push
({
path
:
this
.
redirect
||
"/"
}).
catch
(()
=>
{});
}
}
})
},
tochose
(){
setTenantid
(
this
.
tenantId
)
this
.
$router
.
push
({
path
:
this
.
redirect
||
"/"
}).
catch
(()
=>
{});
this
.
$router
.
push
({
path
:
this
.
redirect
||
"/"
}).
catch
(()
=>
{});
}
}
,
}
}
};
};
</
script
>
</
script
>
...
...
dsk-operate-ui/src/views/system/dept/index.vue
View file @
bb709a4b
...
@@ -154,6 +154,27 @@
...
@@ -154,6 +154,27 @@
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<el-dialog
title=
"验证信息"
:visible
.
sync=
"yanzheng"
width=
"30%"
>
<div
class=
"phonecont"
>
<div
class=
"p1"
><i
class=
"el-icon-warning"
></i>
手机号码验证
</div>
<div>
已经向
<font
color=
"orange"
>
{{phone}}
</font>
发送验证码,请注意查收
</div>
<div>
<el-col
:span=
"6"
>
<span>
请输入短信验证码
</span>
</el-col>
<el-col
:span=
"18"
>
<el-input
v-model=
"yzm"
></el-input>
</el-col>
</div>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel1"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"subyzm"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
</template>
...
@@ -168,6 +189,10 @@ export default {
...
@@ -168,6 +189,10 @@ export default {
components
:
{
Treeselect
},
components
:
{
Treeselect
},
data
()
{
data
()
{
return
{
return
{
yanzheng
:
false
,
phone
:
''
,
yzm
:
''
,
deptId
:
''
,
// 遮罩层
// 遮罩层
loading
:
true
,
loading
:
true
,
// 显示搜索条件
// 显示搜索条件
...
@@ -221,8 +246,26 @@ export default {
...
@@ -221,8 +246,26 @@ export default {
},
},
created
()
{
created
()
{
this
.
getList
();
this
.
getList
();
this
.
phone
=
this
.
$store
.
state
.
user
.
phonenumber
},
},
methods
:
{
methods
:
{
cancel1
(){
this
.
yzm
=
''
this
.
yanzheng
=
false
},
subyzm
(){
delDept
(
row
.
deptId
).
then
(
res
=>
{
if
(
res
.
code
==
200
){
this
.
yzm
=
''
this
.
yanzheng
=
false
this
.
$message
({
type
:
'success'
,
message
:
'删除成功!'
});
}
})
},
/** 查询部门列表 */
/** 查询部门列表 */
getList
()
{
getList
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
...
@@ -328,13 +371,43 @@ export default {
...
@@ -328,13 +371,43 @@ export default {
},
},
/** 删除按钮操作 */
/** 删除按钮操作 */
handleDelete
(
row
)
{
handleDelete
(
row
)
{
this
.
$modal
.
confirm
(
'是否确认删除名称为"'
+
row
.
deptName
+
'"的数据项?'
).
then
(
function
()
{
this
.
deptId
=
row
.
deptId
return
delDept
(
row
.
deptId
);
this
.
$confirm
(
'是否确认删除名称为"'
+
row
.
deptName
+
'"的数据项?'
,
'系统提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
getList
();
this
.
yanzheng
=
true
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{
}).
catch
(()
=>
{});
this
.
$message
({
}
type
:
'info'
,
message
:
'已取消删除'
});
});
// this.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
//
// this.open()
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("删除成功");
// }).catch(() => {});
},
}
}
};
};
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
.phonecont
{
padding-bottom
:
20px
;
.p1
{
.el-icon-warning
{
color
:
#f8ac59
;
margin-right
:
5px
;
}
font-size
:
18px
;
}
>
div
{
line-height
:
36px
;
}
}
</
style
>
dsk-operate-ui/src/views/system/role/index.vue
View file @
bb709a4b
...
@@ -38,12 +38,11 @@
...
@@ -38,12 +38,11 @@
<el-date-picker
<el-date-picker
v-model=
"dateRange"
v-model=
"dateRange"
style=
"width: 240px"
style=
"width: 240px"
value-format=
"yyyy-MM-dd
HH:mm:ss
"
value-format=
"yyyy-MM-dd"
type=
"daterange"
type=
"daterange"
range-separator=
"-"
range-separator=
"-"
start-placeholder=
"开始日期"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00', '23:59:59']"
></el-date-picker>
></el-date-picker>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
...
@@ -383,14 +382,14 @@ export default {
...
@@ -383,14 +382,14 @@ export default {
/** 根据角色ID查询菜单树结构 */
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect
(
roleId
)
{
getRoleMenuTreeselect
(
roleId
)
{
return
roleMenuTreeselect
(
roleId
).
then
(
response
=>
{
return
roleMenuTreeselect
(
roleId
).
then
(
response
=>
{
this
.
menuOptions
=
response
.
data
.
menus
;
this
.
menuOptions
=
response
.
menus
;
return
response
;
return
response
;
});
});
},
},
/** 根据角色ID查询部门树结构 */
/** 根据角色ID查询部门树结构 */
getDeptTree
(
roleId
)
{
getDeptTree
(
roleId
)
{
return
deptTreeSelect
(
roleId
).
then
(
response
=>
{
return
deptTreeSelect
(
roleId
).
then
(
response
=>
{
this
.
deptOptions
=
response
.
d
ata
.
d
epts
;
this
.
deptOptions
=
response
.
depts
;
return
response
;
return
response
;
});
});
},
},
...
@@ -515,7 +514,7 @@ export default {
...
@@ -515,7 +514,7 @@ export default {
this
.
open
=
true
;
this
.
open
=
true
;
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
roleMenu
.
then
(
res
=>
{
roleMenu
.
then
(
res
=>
{
let
checkedKeys
=
res
.
data
.
checkedKeys
let
checkedKeys
=
res
.
checkedKeys
checkedKeys
.
forEach
((
v
)
=>
{
checkedKeys
.
forEach
((
v
)
=>
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
menu
.
setChecked
(
v
,
true
,
false
);
this
.
$refs
.
menu
.
setChecked
(
v
,
true
,
false
);
...
@@ -541,7 +540,7 @@ export default {
...
@@ -541,7 +540,7 @@ export default {
this
.
openDataScope
=
true
;
this
.
openDataScope
=
true
;
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
deptTreeSelect
.
then
(
res
=>
{
deptTreeSelect
.
then
(
res
=>
{
this
.
$refs
.
dept
.
setCheckedKeys
(
res
.
data
.
checkedKeys
);
this
.
$refs
.
dept
.
setCheckedKeys
(
res
.
checkedKeys
);
});
});
});
});
this
.
title
=
"分配数据权限"
;
this
.
title
=
"分配数据权限"
;
...
@@ -604,4 +603,3 @@ export default {
...
@@ -604,4 +603,3 @@ export default {
}
}
};
};
</
script
>
</
script
>
dsk-operate-ui/vue.config.js
View file @
bb709a4b
...
@@ -35,7 +35,8 @@ module.exports = {
...
@@ -35,7 +35,8 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
[
process
.
env
.
VUE_APP_BASE_API
]:
{
// target: `http://47.104.91.229:9099/prod-api`,
// target: `http://47.104.91.229:9099/prod-api`,
target
:
`http://192.168.0.165:9098`
,
//施
// target: `http://192.168.0.165:9098`,//施
target
:
`http://192.168.60.6:9098`
,
//谭
// target: `http://139.9.157.49:9099`,//测试
// target: `http://139.9.157.49:9099`,//测试
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
...
...
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