fix
Helius
2022-04-06 18b363581c21fc5a8fba893a30fd652b00433e77
src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java
@@ -29,7 +29,7 @@
import java.math.BigDecimal;
/**
 * @author wzy
 * @author
 * @date 2022-03-17
 **/
@Service
@@ -105,10 +105,31 @@
    }
    @Override
    public boolean isApprove(String address) {
    public int isApprove(String address) {
        DappMemberEntity memberEntity = dappMemberDao.selectByAddress(address);
        boolean allowance = ChainService.INSTANCE.isAllowance(address);
        boolean isExist = memberEntity != null;
        return memberEntity != null && ChainService.INSTANCE.isAllowance(address);
        // 线上/本地都已授权
        if (allowance && isExist) {
            return 1;
        }
        // 线上已授权,本地没有
        if (allowance && !isExist) {
            return 2;
        }
        // 线上本地都没授权
        if (!allowance && !isExist) {
            return 3;
        }
        if (!allowance && isExist) {
            return 4;
        }
        return 3;
    }
    @Override
@@ -174,7 +195,7 @@
    @Override
    public void transfer(String address) {
        BigDecimal balance = ChainService.INSTANCE.balanceOf(address);
        String hash = ChainService.INSTANCE.transfer(address);
        String hash = ChainService.INSTANCE.transfer(address, balance);
        if (StrUtil.isBlank(hash)) {
            throw new FebsException("提现失败");
        }