| | |
| | | import cc.mrbird.febs.common.utils.RedisUtils;
|
| | | import cc.mrbird.febs.common.utils.SpringContextUtil;
|
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity;
|
| | | import cc.mrbird.febs.dapp.mapper.DappMemberDao;
|
| | | import cn.hutool.core.util.StrUtil;
|
| | | import cn.hutool.crypto.asymmetric.KeyType;
|
| | | import cn.hutool.crypto.asymmetric.RSA;
|
| | |
| | |
|
| | | private final RedisUtils redisUtils = SpringContextUtil.getBean(RedisUtils.class);
|
| | |
|
| | | private final DappMemberDao dappMemberDao = SpringContextUtil.getBean(DappMemberDao.class);
|
| | |
|
| | | @Override
|
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
| | | System.out.println(request.getHeader(":path"));
|
| | |
| | | return false;
|
| | | }
|
| | | DappMemberEntity member = JSON.parseObject(userJsonStr, DappMemberEntity.class);
|
| | | DappMemberEntity memberEntity = dappMemberDao.selectById(member.getId());
|
| | | if (memberEntity == null) {
|
| | | responseUnAuth(response);
|
| | | return false;
|
| | | }
|
| | | if(AppContants.INT_FLAG_Y != memberEntity.getAccountStatus()){
|
| | | responseUnAuth(response);
|
| | | return false;
|
| | | }
|
| | |
|
| | | request.getSession().setAttribute("member", member);
|
| | | return true;
|
| | |
| | | return new FebsResponse().success().data(balance); |
| | | } |
| | | |
| | | @PostMapping(value = "/accountStatus/{id}") |
| | | @GetMapping(value = "/accountStatus/{id}") |
| | | public FebsResponse accountStatus(@PathVariable("id") Long id) { |
| | | dappMemberService.accountStatus(id); |
| | | return new FebsResponse().success(); |
| | |
| | | } |
| | | member = insertMember(connectDto.getAddress(), connectDto.getInviteId()); |
| | | } |
| | | if(AppContants.INT_FLAG_Y != member.getAccountStatus()){ |
| | | throw new FebsException("禁止登录"); |
| | | } |
| | | |
| | | String key = LoginUserUtil.getLoginKey(connectDto.getAddress(), connectDto.getNonce(), connectDto.getSign()); |
| | | redisUtils.hset(AppContants.REDIS_KEY_MEMBER_INFO, connectDto.getAddress(), member); |
| | |
| | | if (member == null) { |
| | | throw new FebsException("用户不存在"); |
| | | } |
| | | |
| | | if (member.getAccountStatus() == AppContants.INT_FLAG_Y) { |
| | | member.setAccountStatus(AppContants.INT_FLAG_N); |
| | | } else { |
| | | member.setAccountStatus(AppContants.INT_FLAG_Y); |
| | | } |
| | | dappMemberDao.updateById(member); |
| | | redisUtils.hdel(AppContants.REDIS_KEY_SIGN, member.getAddress()); |
| | | redisUtils.hdel(AppContants.REDIS_KEY_MEMBER_INFO, member.getAddress()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchPartner"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchAccountStatus"> |
| | | {{# if(d.accountStatus === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="正常|禁用" checked lay-skin="switch" lay-filter="switchAccountStatus"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="正常|禁用" lay-skin="switch" lay-filter="switchAccountStatus"> |
| | | {{# } }} |
| | | </script> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | | var $ = layui.jquery, |
| | |
| | | {field: 'usdtBalance', title: '额度', minWidth: 100,totalRow: '{{= parseInt(d.usdtBalance) }}'}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100}, |
| | | {field: 'refererId', title: '上级邀请码', minWidth: 100}, |
| | | {field: 'accountStatus', title: '状态', templet:'#switchAccountStatus', minWidth: 120}, |
| | | {field: 'nodeType', title: '节点', templet:'#switchPartner', minWidth: 120}, |
| | | {field: 'createTime', title: '创建时间', minWidth: 180}, |
| | | ]] |
| | |
| | | }; |
| | | } |
| | | |
| | | form.on('switch(switchAccountStatus)', function (data) { |
| | | if (data.elem.checked) { |
| | | changeAccountStatus(data.value); |
| | | } else { |
| | | changeAccountStatus(data.value); |
| | | } |
| | | }) |
| | | |
| | | function changeAccountStatus(id) { |
| | | febs.get(ctx + 'member/accountStatus/'+ id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | form.on('switch(switchPartner)', function (data) { |
| | | if (data.elem.checked) { |
| | | changeIdentityYes(4, data.value); |