Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
三久
DolphinScheduler
提交
7a20fa38
DolphinScheduler
项目概览
三久
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7a20fa38
编写于
5月 10, 2019
作者:
journey2018
提交者:
GitHub
5月 10, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #271 from qiaozhanwei/branch-1.0.2
update admin gen token
上级
079a7ed8
27b20b52
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
94 addition
and
5 deletion
+94
-5
escheduler-api/src/main/java/cn/escheduler/api/controller/UsersController.java
...in/java/cn/escheduler/api/controller/UsersController.java
+22
-1
escheduler-api/src/main/java/cn/escheduler/api/service/UsersService.java
...src/main/java/cn/escheduler/api/service/UsersService.java
+21
-0
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java
...ao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java
+19
-0
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java
...ain/java/cn/escheduler/dao/mapper/UserMapperProvider.java
+17
-1
escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/createToken.vue
.../conf/home/pages/user/pages/token/_source/createToken.vue
+2
-2
escheduler-ui/src/js/conf/home/store/security/actions.js
escheduler-ui/src/js/conf/home/store/security/actions.js
+13
-1
未找到文件。
escheduler-api/src/main/java/cn/escheduler/api/controller/UsersController.java
浏览文件 @
7a20fa38
...
@@ -135,7 +135,7 @@ public class UsersController extends BaseController{
...
@@ -135,7 +135,7 @@ public class UsersController extends BaseController{
logger
.
info
(
"login user {}, updateProcessInstance user, userName: {}, email: {}, tenantId: {}, userPassword: {}, phone: {}, user queue: {}"
,
logger
.
info
(
"login user {}, updateProcessInstance user, userName: {}, email: {}, tenantId: {}, userPassword: {}, phone: {}, user queue: {}"
,
loginUser
.
getUserName
(),
userName
,
email
,
tenantId
,
Constants
.
PASSWORD_DEFAULT
,
phone
,
queue
);
loginUser
.
getUserName
(),
userName
,
email
,
tenantId
,
Constants
.
PASSWORD_DEFAULT
,
phone
,
queue
);
try
{
try
{
Map
<
String
,
Object
>
result
=
usersService
.
updateUser
(
id
,
userName
,
userPassword
,
email
,
tenantId
,
phone
,
queue
);
Map
<
String
,
Object
>
result
=
usersService
.
updateUser
(
id
,
userName
,
userPassword
,
email
,
tenantId
,
phone
,
queue
);
return
returnDataList
(
result
);
return
returnDataList
(
result
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
logger
.
error
(
UPDATE_USER_ERROR
.
getMsg
(),
e
);
logger
.
error
(
UPDATE_USER_ERROR
.
getMsg
(),
e
);
...
@@ -283,6 +283,26 @@ public class UsersController extends BaseController{
...
@@ -283,6 +283,26 @@ public class UsersController extends BaseController{
@GetMapping
(
value
=
"/list"
)
@GetMapping
(
value
=
"/list"
)
@ResponseStatus
(
HttpStatus
.
OK
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
listUser
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
){
public
Result
listUser
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
){
logger
.
info
(
"login user {}, user list"
);
try
{
Map
<
String
,
Object
>
result
=
usersService
.
queryAllGeneralUsers
(
loginUser
);
return
returnDataList
(
result
);
}
catch
(
Exception
e
){
logger
.
error
(
USER_LIST_ERROR
.
getMsg
(),
e
);
return
error
(
Status
.
USER_LIST_ERROR
.
getCode
(),
Status
.
USER_LIST_ERROR
.
getMsg
());
}
}
/**
* user list no paging
*
* @param loginUser
* @return
*/
@GetMapping
(
value
=
"/list-all"
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
Result
listAll
(
@RequestAttribute
(
value
=
Constants
.
SESSION_USER
)
User
loginUser
){
logger
.
info
(
"login user {}, user list"
);
logger
.
info
(
"login user {}, user list"
);
try
{
try
{
Map
<
String
,
Object
>
result
=
usersService
.
queryUserList
(
loginUser
);
Map
<
String
,
Object
>
result
=
usersService
.
queryUserList
(
loginUser
);
...
@@ -293,6 +313,7 @@ public class UsersController extends BaseController{
...
@@ -293,6 +313,7 @@ public class UsersController extends BaseController{
}
}
}
}
/**
/**
* verify username
* verify username
*
*
...
...
escheduler-api/src/main/java/cn/escheduler/api/service/UsersService.java
浏览文件 @
7a20fa38
...
@@ -518,6 +518,27 @@ public class UsersService extends BaseService {
...
@@ -518,6 +518,27 @@ public class UsersService extends BaseService {
return
result
;
return
result
;
}
}
/**
* query user list
*
* @param loginUser
* @return
*/
public
Map
<
String
,
Object
>
queryAllGeneralUsers
(
User
loginUser
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
5
);
//only admin can operate
if
(
check
(
result
,
!
isAdmin
(
loginUser
),
Status
.
USER_NO_OPERATION_PERM
,
Constants
.
STATUS
))
{
return
result
;
}
List
<
User
>
userList
=
userMapper
.
queryAllGeneralUsers
();
result
.
put
(
Constants
.
DATA_LIST
,
userList
);
putMsg
(
result
,
Status
.
SUCCESS
);
return
result
;
}
/**
/**
* query user list
* query user list
*
*
...
...
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java
浏览文件 @
7a20fa38
...
@@ -76,6 +76,25 @@ public interface UserMapper {
...
@@ -76,6 +76,25 @@ public interface UserMapper {
@SelectProvider
(
type
=
UserMapperProvider
.
class
,
method
=
"queryById"
)
@SelectProvider
(
type
=
UserMapperProvider
.
class
,
method
=
"queryById"
)
User
queryById
(
@Param
(
"userId"
)
int
userId
);
User
queryById
(
@Param
(
"userId"
)
int
userId
);
/**
* query all general user list
* @return
*/
@Results
(
value
=
{
@Result
(
property
=
"id"
,
column
=
"id"
,
id
=
true
,
javaType
=
Integer
.
class
,
jdbcType
=
JdbcType
.
INTEGER
),
@Result
(
property
=
"userName"
,
column
=
"user_name"
,
javaType
=
String
.
class
,
jdbcType
=
JdbcType
.
VARCHAR
),
@Result
(
property
=
"userPassword"
,
column
=
"user_password"
,
javaType
=
String
.
class
,
jdbcType
=
JdbcType
.
VARCHAR
),
@Result
(
property
=
"email"
,
column
=
"email"
,
javaType
=
String
.
class
,
jdbcType
=
JdbcType
.
VARCHAR
),
@Result
(
property
=
"phone"
,
column
=
"phone"
,
javaType
=
String
.
class
,
jdbcType
=
JdbcType
.
VARCHAR
),
@Result
(
property
=
"userType"
,
column
=
"user_type"
,
typeHandler
=
EnumOrdinalTypeHandler
.
class
,
javaType
=
UserType
.
class
,
jdbcType
=
JdbcType
.
TINYINT
),
@Result
(
property
=
"tenantId"
,
column
=
"tenant_id"
,
javaType
=
Integer
.
class
,
jdbcType
=
JdbcType
.
INTEGER
),
@Result
(
property
=
"createTime"
,
column
=
"create_time"
,
javaType
=
Timestamp
.
class
,
jdbcType
=
JdbcType
.
DATE
),
@Result
(
property
=
"updateTime"
,
column
=
"update_time"
,
javaType
=
Timestamp
.
class
,
jdbcType
=
JdbcType
.
DATE
)
})
@SelectProvider
(
type
=
UserMapperProvider
.
class
,
method
=
"queryAllGeneralUsers"
)
List
<
User
>
queryAllGeneralUsers
();
/**
/**
* query all user list
* query all user list
* @return
* @return
...
...
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java
浏览文件 @
7a20fa38
...
@@ -118,7 +118,7 @@ public class UserMapperProvider {
...
@@ -118,7 +118,7 @@ public class UserMapperProvider {
*
*
* @return
* @return
*/
*/
public
String
queryAllUsers
()
{
public
String
queryAll
General
Users
()
{
return
new
SQL
()
{
return
new
SQL
()
{
{
{
SELECT
(
"*"
);
SELECT
(
"*"
);
...
@@ -130,6 +130,22 @@ public class UserMapperProvider {
...
@@ -130,6 +130,22 @@ public class UserMapperProvider {
}.
toString
();
}.
toString
();
}
}
/**
* query all user list
*
* @return
*/
public
String
queryAllUsers
()
{
return
new
SQL
()
{
{
SELECT
(
"*"
);
FROM
(
TABLE_NAME
);
}
}.
toString
();
}
/**
/**
* check user name and password
* check user name and password
*
*
...
...
escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/createToken.vue
浏览文件 @
7a20fa38
...
@@ -140,7 +140,7 @@
...
@@ -140,7 +140,7 @@
}
}
}
}
if
(
this
.
auth
)
{
if
(
this
.
auth
)
{
this
.
store
.
dispatch
(
`security/getUsers
List
`
).
then
(
res
=>
{
this
.
store
.
dispatch
(
`security/getUsers
All
`
).
then
(
res
=>
{
this
.
userIdList
=
_
.
map
(
res
,
v
=>
_
.
pick
(
v
,
[
'
id
'
,
'
userName
'
]))
this
.
userIdList
=
_
.
map
(
res
,
v
=>
_
.
pick
(
v
,
[
'
id
'
,
'
userName
'
]))
d
(
this
.
userIdList
[
0
].
id
)
d
(
this
.
userIdList
[
0
].
id
)
})
})
...
@@ -158,4 +158,4 @@
...
@@ -158,4 +158,4 @@
.create-token-model
{
.create-token-model
{
width
:
640px
;
width
:
640px
;
}
}
</
style
>
</
style
>
\ No newline at end of file
escheduler-ui/src/js/conf/home/store/security/actions.js
浏览文件 @
7a20fa38
...
@@ -100,7 +100,7 @@ export default {
...
@@ -100,7 +100,7 @@ export default {
})
})
},
},
/**
/**
*
Paging query user list
*
user list expect admin
*/
*/
getUsersList
({
state
},
payload
)
{
getUsersList
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -111,6 +111,18 @@ export default {
...
@@ -111,6 +111,18 @@ export default {
})
})
})
})
},
},
/**
* user all list
*/
getUsersAll
({
state
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
io
.
get
(
`users/list-all`
,
payload
,
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
e
=>
{
reject
(
e
)
})
})
},
/**
/**
* Update user
* Update user
* @param "id":int,
* @param "id":int,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录