package com.bjtdba.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class TokenUtils {

    /**
     * uid+phone+时间  b64加密
     */
    public static String thoken(int uid,String phone){
        SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
        Date date = new Date(System.currentTimeMillis());
        System.out.println(formatter.format(date));
        String token = uid+phone+formatter.format(date);
        //uid 登录的时候获取
        String tokenPwd = Base64Converter.encode(token);
        return tokenPwd;
    }
}
