liujie
2025-11-21 a4185711a1bd960448bbcbd977aa9ce24751081e
斗拱
1个文件已添加
1个文件已修改
30 ■■■■■ 已修改文件
DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/WinxinController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/WxMpConfig.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/WinxinController.java
@@ -35,7 +35,7 @@
    @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"),
DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/WxMpConfig.java
New file
@@ -0,0 +1,28 @@
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;
    }
}