| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/wx/getOpenId") |
| | | @ApiOperation(value = "获取最新版本数据", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "获取最新openId", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "code", name = "code", required = true, dataType = "String"), |
| New file |
| | |
| | | package com.stylefeng.guns.modular.huifu.biz; |
| | | |
| | | import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage; |
| | | import me.chanjar.weixin.mp.api.WxMpService; |
| | | import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class WxMpConfig { |
| | | @Value("${wx.appid}") |
| | | private String appid;//微信appid |
| | | |
| | | @Value("${wx.appSecret}") |
| | | private String Secret; |
| | | |
| | | |
| | | @Bean |
| | | public WxMpService wxMpService(){ |
| | | WxMpService wxMpService = new WxMpServiceImpl(); |
| | | WxMpInMemoryConfigStorage ConfigStorage = new WxMpInMemoryConfigStorage(); |
| | | ConfigStorage.setAppId(appid); |
| | | ConfigStorage.setSecret(Secret); |
| | | wxMpService.setWxMpConfigStorage(ConfigStorage); |
| | | return wxMpService; |
| | | } |
| | | } |