puzhibing
2023-06-13 11b4c2cf16ff93e4e4955f88db3ae9c28d6f7782
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
package com.dsh.app.util.akeylogin;
 
 
 
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
 
import java.util.HashMap;
 
public class LoginUtil {
    private static String appkey = "*******";
    private static String appSecret = "*****";
    private static String authHost = "http://identify.verify.mob.com/";
    private static String url = authHost + "auth/auth/sdkClientFreeLogin";
 
    public static String getPhoneNumber(String mbToken,String opToken, String operator) throws Exception {
        HashMap<String, Object> request = new HashMap<>();
        request.put("appkey", appkey);
        request.put("token", mbToken);
        request.put("opToken",opToken);
        request.put("operator", operator);
        request.put("timestamp", System.currentTimeMillis());
        request.put("sign", SignUtil.getSign(request, appSecret));
        String response = Auth.postRequestNoSecurity(url, null, request);
        JSONObject jsonObject = JSONObject.parseObject(response);
        if (200 == jsonObject.getInteger("status")) {
            String res = jsonObject.getString("res");
            byte[] decode = DES.decode(Base64Utils.decode(res.getBytes()), appSecret.getBytes());
            jsonObject.put("res", JSONObject.parseObject(new String(decode)));
        }
 
        JSONObject jsonObject1 = JSON.parseObject(jsonObject.toString());
        String data = jsonObject1.getString("res");
        JSONObject jsondata = JSON.parseObject(data);
        return jsondata.getString("phone");
    }
}
*/