Browse Source

配置公众号对接完成,初上线版

DESKTOP-3Q5PM1M\896986 2 weeks ago
parent
commit
3e000fb281

+ 4 - 2
complaint-admin/src/main/resources/application-prod.yml

@@ -109,8 +109,10 @@ logging:
 # ⚠️ 涉密配置:生产环境建议用外部配置文件覆盖,勿硬编码在jar包中
 wechat:
     appid: wxc0601b88a9fcfd92              # 【必须修改】公众号AppID
-    secret: c2c6d55737319fad07b713d4890b503  # 【必须修改】公众号AppSecret
-    oauth-redirect: https://你的域名/h5/    # 【必须修改】网页授权回调地址(正式域名)
+    secret: c2c6d55737319fad07b713d4890b503f  # 【必须修改】公众号AppSecret
+    # 【演示期临时置空】置空后 authReady=false,前端自动走联调模式(模拟身份 X-Openid),
+    # 浏览器/PC 可直接打开 H5,不再跳微信授权页;甲方域名配置完成后填回 https://正式域名/h5/ 即恢复真实授权
+    oauth-redirect: "https://zhxy.whjyyun.cn/complaint-h5/"
     session-ttl-minutes: 120
 
 # ==================== 9. 统一通讯平台(消息推送) ====================

+ 0 - 14
complaint-admin/src/main/resources/application.yml

@@ -48,20 +48,6 @@ user:
 
 # Spring 配置
 spring:
-  # MyBatis 配置
-  mybatis:
-    # Mapper 文件位置
-    mapper-locations: classpath*:mapper/**/*.xml
-    # 类型别名
-    type-aliases-package: com.complaint.*.domain
-    # Sql 配置文件位置
-    config-location: classpath:mybatis/mybatis-config.xml
-    # 开启驼峰命名映射
-    configuration:
-      map-underscore-to-camel-case: true
-      cache-enabled: false
-      use-generated-keys: true
-      default-statement-timeout: 30
   # 资源信息
   messages:
     # 国际化资源文件路径

+ 1 - 0
h5-app/src/api/admin.js

@@ -3,6 +3,7 @@ import { showToast } from 'vant'
 
 // 管理端 H5 请求封装:携带免登会话凭证 X-Admin-Token
 const adminRequest = axios.create({
+  baseURL: '/complaint-h5',
   timeout: 30000
 })
 

+ 1 - 0
h5-app/src/api/request.js

@@ -3,6 +3,7 @@ import { showToast } from 'vant'
 
 // 请求封装:携带微信授权会话 token(联调模式兼容 openid)
 const request = axios.create({
+  baseURL: '/complaint-h5',
   timeout: 30000
 })
 

+ 8 - 2
h5-app/src/pages/ComplaintDetail.vue

@@ -130,10 +130,16 @@ function parseImages(json) {
       urls = []
     }
   }
-  // 拼接缓存破坏参数,绕过之前错误缓存的 HTML
-  return urls.map(u => u + (u.includes('?') ? '&' : '?') + 'v=' + IMG_CACHE_VER)
+  // 先处理路径前缀,再拼接缓存破坏参数
+  return urls.map(url => {
+    // 给 /profile/ 开头路径增加前缀
+    let finalUrl = url.startsWith('/profile/') ? '/complaint-h5' + url : url
+    // 追加缓存版本
+    return finalUrl + (finalUrl.includes('?') ? '&' : '?') + 'v=' + IMG_CACHE_VER
+  })
 }
 
+
 /** 投诉附件图片列表 */
 const imageList = computed(() => parseImages(workorder.value?.images))
 

+ 6 - 2
h5-app/src/pages/admin/Workorder.vue

@@ -128,9 +128,13 @@ function parseImages(images) {
   if (!images) return []
   try {
     const arr = JSON.parse(images)
-    return Array.isArray(arr) ? arr : []
+    return Array.isArray(arr) 
+      ? arr.map(url => url.startsWith('/profile/') ? '/complaint-h5' + url : url) 
+      : []
   } catch (e) {
-    return images.split(',').filter(Boolean)
+    return images.split(',')
+      .filter(Boolean)
+      .map(url => url.startsWith('/profile/') ? '/complaint-h5' + url : url)
   }
 }
 

+ 1 - 1
h5-app/vite.config.js

@@ -4,7 +4,7 @@ import vue from '@vitejs/plugin-vue'
 // 群众端 H5:/h5 路径部署;/api 代理到后端
 export default defineConfig({
   plugins: [vue()],
-  base: '/h5/',
+  base: '/complaint-h5/',
   server: {
     port: 11022,
     proxy: {

+ 10 - 0
ruoyi-ui/src/settings.js

@@ -1,4 +1,9 @@
 export default {
+  /**
+   * 系统版本号
+   */
+  version: '1.0.0',
+
   /**
    * 网页标题
    */
@@ -65,3 +70,8 @@ export default {
   footerContent: 'Copyright © 2026 乌海市教育信息中心。All Rights Reserved.'
 }
 
+/**
+ * 系统版本号(命名导出,供首页等页面直接导入)
+ */
+export const version = '1.0.0' 
+