Commit cc04b388 by HlQ

[add] 添加注销接口

[chg] 拦截器优化以及合同接口优化
1 parent 0cefa4b3
......@@ -46,8 +46,8 @@ public class ContractController {
}
@PostMapping("/contract/store")
@SaCheckPermission(value = "contract:store", orRole="admin")
public String ss(List<RContractStore> contractStoreList) {
@SaCheckPermission(value = "contract:store:edit", orRole = "admin")
public String saveOrUpdateRContractStore(@RequestBody List<RContractStore> contractStoreList) {
return contractStoreService.saveBatch(contractStoreList) ? "更新成功" : "更新失败";
}
......
......@@ -23,7 +23,7 @@ public class ContractPaymentController {
@PostMapping("/contractPayment")
@SaCheckPermission(value = "contractPayment:edit", orRole="admin")
public String updPayment(List<ContractPaymentDTO> dtoList) {
public String updPayment(@RequestBody List<ContractPaymentDTO> dtoList) {
return contractPaymentService.saveBatch(converter.convert(dtoList, ContractPayment.class)) ? "更新成功" : "更新失败";
}
......
package vion.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.lang.Opt;
import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -90,6 +91,12 @@ public class UserController {
return dingMod.dingCallback(target, dto, res);
}
@GetMapping("/logout/{id}")
public String logout(@PathVariable Long id) {
StpUtil.logout(id);
return "注销成功";
}
@GetMapping("/wechat/callback")
public Object wechatCallback(String code, Long taskTempId) {
Object obj = wechatMod.wechatCallback(code);
......
......@@ -2,6 +2,8 @@ package vion.interceptor;
import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.lang.Opt;
import org.springframework.stereotype.Component;
import vion.vo.RoleVO;
import vion.vo.UserVO;
......@@ -26,6 +28,6 @@ public class StpInterfaceImpl implements StpInterface {
public List<String> getRoleList(Object loginId, String loginType) {
UserVO userVO = (UserVO) StpUtil.getTokenSession().get("curLoginUser");
List<RoleVO> roleVOList = userVO.getRoleVOList();
return roleVOList.stream().map(RoleVO::getCode).collect(Collectors.toList());
return Opt.ofEmptyAble(roleVOList).map(list -> list.stream().map(RoleVO::getCode).collect(Collectors.toList())).orElse(ListUtil.empty());
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!