package cn.iocoder.yudao.common;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class WechatCommon {
    /**
     * 微信公众号APPID
     */
    @Value(value = "${wx.mp.app-id}")
    public String APP_ID;
    /**
     * 微信公众号秘钥
     */
    @Value(value = "${wx.mp.secret}")
    public String APP_SECRET;

    /**
     * 获取网页的token,后续还有+"&code=&grant_type=authorization_code"
     **/
    public String getTokeUrl(){
        String appId = APP_ID;
        String appSecret = APP_SECRET;
        return  "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + appId + "&secret=" + appSecret;
    }
}
