lyh
8 小时以前 371365543363969fd3afcc404440c838817ecc3d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package com.lxzn.framework.utils;
 
import org.springframework.util.Base64Utils;
 
/**
 * Created by mrt on 2018/5/25.
 */
public class Oauth2Util {
    //获取httpbasic的串
    public static String getHttpBasic(String clientId,String clientSecret){
        String string = clientId+":"+clientSecret;
        //将串进行base64编码
        byte[] encode = Base64Utils.encode(string.getBytes());
        return "Basic "+new String(encode);
    }
}