feiyu02
2022-09-15 3e2159e45e12b2b8af058b68eafeaf082cf3fe85
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package cn.flightfeather.supervision.common.net
 
/**
 * @author riku
 * Date: 2020/10/15
 * 微信服务接口
 */
object WXHttpService {
 
    private const val APP_ID=""
    private const val SECRET = ""
    private val httpMethod = HttpMethod("api.weixin.qq.com", 443, true)
 
    /**
     * 微信登录凭证校验
     */
    fun code2Session(code: String): HttpMethod.MyResponse =
        httpMethod.get(
            "/sns/jscode2session", listOf(
                Pair("appid", APP_ID), Pair("secret", SECRET), Pair("js_code", code), Pair("grant_type", "authorization_code")
            )
        )
}