From 5c5cddb1c2ee0d19adddebaf3a3a10a6d93fd2ad Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 26 十月 2025 10:52:18 +0800
Subject: [PATCH] feat:优化微信小程序可以运行
---
app/config.js | 51 ++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 44 insertions(+), 7 deletions(-)
diff --git a/app/config.js b/app/config.js
index 6f9236d..4ca54be 100644
--- a/app/config.js
+++ b/app/config.js
@@ -1,25 +1,62 @@
// 搴旂敤鍏ㄥ眬閰嶇疆
+
+// 鈿狅笍 閲嶈锛氭湰鍦板紑鍙戞椂锛岃淇敼姝ゅ鐨凩OCAL_IP涓轰綘鐨勭數鑴戝唴缃慖P
+// Windows鏌ョ湅: cmd鎵ц ipconfig
+// Mac/Linux鏌ョ湅: 缁堢鎵ц ifconfig 鎴� ip addr
+const LOCAL_IP = 'localhost' // 淇敼涓轰綘鐨処P锛屽: '192.168.1.100'
+
+// 鐜閰嶇疆
+const ENV_CONFIG = {
+ // 鏈湴寮�鍙戠幆澧�
+ development: {
+ baseUrl: `http://${LOCAL_IP}:8080`,
+ description: '鏈湴寮�鍙戠幆澧�'
+ },
+ // 娴嬭瘯鐜
+ test: {
+ baseUrl: 'http://test.yourdomain.com',
+ description: '娴嬭瘯鐜'
+ },
+ // 鐢熶骇鐜
+ production: {
+ baseUrl: 'https://api.yourdomain.com',
+ description: '鐢熶骇鐜'
+ }
+}
+
+// 褰撳墠浣跨敤鐨勭幆澧冿紙鎵嬪姩鍒囨崲锛�
+// 鍙�夊��: 'development', 'test', 'production'
+const CURRENT_ENV = 'development'
+
module.exports = {
- baseUrl: 'https://vue.ruoyi.vip/prod-api',
- // baseUrl: 'http://localhost:8080',
+ // API鍩虹鍦板潃
+ baseUrl: ENV_CONFIG[CURRENT_ENV].baseUrl,
+
// 搴旂敤淇℃伅
appInfo: {
// 搴旂敤鍚嶇О
- name: "ruoyi-app",
+ name: "姘戣埅璋冨害绯荤粺",
// 搴旂敤鐗堟湰
version: "1.1.0",
// 搴旂敤logo
logo: "/static/logo.png",
// 瀹樻柟缃戠珯
site_url: "http://ruoyi.vip",
- // 鏀跨瓥鍗忚
- agreements: [{
+
+ // 褰撳墠鐜淇℃伅锛堜粎寮�鍙戞椂鏄剧ず锛�
+ env: CURRENT_ENV,
+ envDescription: ENV_CONFIG[CURRENT_ENV].description,
+ showEnv: CURRENT_ENV === 'development', // 鏄惁鏄剧ず鐜淇℃伅
+
+ // 鏀跨瓥鍗忚锛堜娇鐢ㄦ湰鍦伴〉闈級
+ agreements: [
+ {
title: "闅愮鏀跨瓥",
- url: "https://ruoyi.vip/protocol.html"
+ url: "/pages/mine/privacy-policy/index"
},
{
title: "鐢ㄦ埛鏈嶅姟鍗忚",
- url: "https://ruoyi.vip/protocol.html"
+ url: "/pages/mine/user-agreement/index"
}
]
}
--
Gitblit v1.9.1