lyh
5 天以前 fda571324684bc8d0945b3e2841305b1207fc3e9
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);
    }
}