liujie
2025-12-24 f4e730b582f6c170c6e3f5799d9b061022ed1f3a
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCompanyController.java
@@ -8,6 +8,7 @@
import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@@ -199,7 +200,7 @@
    @GetMapping(value = "/getQrcode")
    public R<String> getQrcode(@RequestParam Long  userId) {
        SysUser sysUser = userService.selectUserById(userId);
        Object o = redisTemplate.opsForValue().get("ADMIN_WX_IMG" + sysUser.getCode());
        Object o = redisTemplate.opsForValue().get("ADMIN_WX_IMG" + sysUser.getUserId());
        if(o!=null){
            return R.ok(o.toString());
        }
@@ -208,12 +209,13 @@
        Map<String, Object> param = new HashMap<>();
        param.put("page", "pages/home/home");
        param.put("width", 430); //二维码尺寸
        param.put("scene", "userId=" + userId); //二维码尺寸
        param.put("scene",  "code=" + sysUser.getCode()+"&type=1"); //二维码尺寸
        param.put("env_version", "trial"); //二维码尺寸
        param.put("check_path", false); //二维码尺寸
        HttpRequest post = HttpUtil.createPost(url);
        post.body(JSON.toJSONString(param));
        byte[] result = post.execute().bodyBytes();
        HttpResponse execute = post.execute();
        byte[] result =execute .bodyBytes();
        // base64
        String img = Base64.getEncoder().encodeToString(result);
        // 后台用户的小程序码