From c9e9737a7584ebf84e12ecc956a337c3f8f0d67b Mon Sep 17 00:00:00 2001
From: “mitao” <“2763622819@qq.com”>
Date: 星期一, 02 二月 2026 16:33:09 +0800
Subject: [PATCH] fix:小程序码生成增加环境判断

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCompanyController.java |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCompanyController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCompanyController.java
index 4df9dd3..dbe0eee 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCompanyController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCompanyController.java
@@ -82,7 +82,8 @@
     private final TAppUserService appUserService ;
     private final TBigGiftPackageOrderService bigGiftPackageOrderService;
 
-
+    @Value("${spring.profiles.active}")
+    private String env;
     public TCompanyController(TCompanyService companyService, ISysUserService userService, RedisTemplate redisTemplate, TAppUserService appUserService, TBigGiftPackageOrderService bigGiftPackageOrderService) {
         this.companyService = companyService;
         this.userService = userService;
@@ -219,7 +220,7 @@
         param.put("page", "pages/home/home");
         param.put("width", 430); //二维码尺寸
         param.put("scene",  "code=" + sysUser.getCode()+"&type=1"); //二维码尺寸
-        param.put("env_version", "trial"); //二维码尺寸
+        param.put("env_version", env.equals("prod") ? "release" : "trial"); //二维码尺寸
         param.put("check_path", false); //二维码尺寸
         HttpRequest post = HttpUtil.createPost(url);
         post.body(JSON.toJSONString(param));
@@ -295,7 +296,7 @@
             param.put("page", "pages/home/home");
             param.put("width", 430); //二维码尺寸
             param.put("scene", "code=" + user.getCode()+"&type=1"); //二维码尺寸
-            param.put("env_version", "trial"); //二维码尺寸
+            param.put("env_version", env.equals("prod") ? "release" : "trial"); //二维码尺寸
             param.put("check_path", false); //二维码尺寸
             HttpRequest post = HttpUtil.createPost(url);
             post.body(JSON.toJSONString(param));

--
Gitblit v1.7.1