提交 41dcea34 编写于 作者: L lenve

修复hr角色请求路径

上级 5414bcb7
...@@ -2,7 +2,9 @@ package org.sang.controller.system; ...@@ -2,7 +2,9 @@ package org.sang.controller.system;
import org.sang.bean.Hr; import org.sang.bean.Hr;
import org.sang.bean.RespBean; import org.sang.bean.RespBean;
import org.sang.bean.Role;
import org.sang.service.HrService; import org.sang.service.HrService;
import org.sang.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -19,6 +21,8 @@ import java.util.List; ...@@ -19,6 +21,8 @@ import java.util.List;
public class SystemHrController { public class SystemHrController {
@Autowired @Autowired
HrService hrService; HrService hrService;
@Autowired
RoleService roleService;
@RequestMapping("/id/{hrId}") @RequestMapping("/id/{hrId}")
public Hr getHrById(@PathVariable Long hrId) { public Hr getHrById(@PathVariable Long hrId) {
...@@ -55,6 +59,10 @@ public class SystemHrController { ...@@ -55,6 +59,10 @@ public class SystemHrController {
return hrs; return hrs;
} }
@RequestMapping(value = "/roles",method = RequestMethod.GET)
public List<Role> allRoles() {
return roleService.roles();
}
@RequestMapping(value = "/hr/reg", method = RequestMethod.POST) @RequestMapping(value = "/hr/reg", method = RequestMethod.POST)
public RespBean hrReg(String username, String password) { public RespBean hrReg(String username, String password) {
......
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
_this.eploading.splice(index, 1, false); _this.eploading.splice(index, 1, false);
if (resp && resp.status == 200) { if (resp && resp.status == 200) {
var data = resp.data; var data = resp.data;
if (data.status == 200) { if (data.status == 200) {
_this.refreshHr(hrId, index); _this.refreshHr(hrId, index);
} }
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
}, },
loadAllRoles(){ loadAllRoles(){
var _this = this; var _this = this;
this.getRequest("/system/basic/roles").then(resp=> { this.getRequest("/system/hr/roles").then(resp=> {
_this.fullloading = false; _this.fullloading = false;
if (resp && resp.status == 200) { if (resp && resp.status == 200) {
_this.allRoles = resp.data; _this.allRoles = resp.data;
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
_this.cardLoading.splice(index, 1, false) _this.cardLoading.splice(index, 1, false)
if (resp && resp.status == 200) { if (resp && resp.status == 200) {
var data = resp.data; var data = resp.data;
if (data.status == 'error') { if (data.status == 'error') {
_this.refreshHr(hrId, index); _this.refreshHr(hrId, index);
} }
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
_this.fullloading = false; _this.fullloading = false;
if (resp && resp.status == 200) { if (resp && resp.status == 200) {
var data = resp.data; var data = resp.data;
if (data.status == 'success') { if (data.status == 'success') {
_this.initCards(); _this.initCards();
_this.loadAllRoles(); _this.loadAllRoles();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册