| | |
| | | package cc.mrbird.febs.common.utils; |
| | | |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | import org.web3j.crypto.Hash; |
| | |
| | | * @author |
| | | * @date 2022-03-18 |
| | | **/ |
| | | @Slf4j |
| | | public class LoginUserUtil { |
| | | |
| | | public static DappMemberEntity getAppUser() { |
| | |
| | | } |
| | | |
| | | public static String getLoginKey(String address, String nonce, String sign) { |
| | | log.info("address:{}, nonce:{}, sign:{}", address, nonce, sign); |
| | | StringBuilder sb = new StringBuilder(); |
| | | StringBuilder append = sb.append(address).append(":").append(nonce).append(":").append(sign); |
| | | |
| | | return append.toString(); |
| | | return Hash.sha3(append.toString()); |
| | | } |
| | | } |