web
This commit is contained in:
@@ -58,8 +58,8 @@ wechatPay:
|
||||
certPath: "certs/apiclient_cert.pem" # 商户证书路径
|
||||
keyPath: "certs/apiclient_key.pem" # 商户私钥路径
|
||||
serialNo: "26DA8C2BC03B796222DA3FCFC6825B236A8C7538" # 证书序列号
|
||||
notifyUrl: "http://192.168.10.109:8081/api/v1/payment/notify" # 支付回调地址
|
||||
refundNotifyUrl: "http://192.168.10.109:8081/api/refunds/callback" # 退款回调地址
|
||||
notifyUrl: "https://tral.cc/api/v1/payment/notify" # 支付回调地址
|
||||
refundNotifyUrl: "https://tral.cc/api/refunds/callback" # 退款回调地址
|
||||
|
||||
upload:
|
||||
maxImageSize: 5242880 # 5MB (5 * 1024 * 1024)
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
# 阿里云OSS配置示例
|
||||
# 将此文件复制为 config.yaml 或 config.prod.yaml,并填入你的实际配置信息
|
||||
|
||||
server:
|
||||
port: 8080
|
||||
mode: release
|
||||
|
||||
database:
|
||||
driver: mysql
|
||||
host: 127.0.0.1
|
||||
port: 3306
|
||||
username: root
|
||||
password: "your-password"
|
||||
dbname: ai_dianshang
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 0
|
||||
|
||||
jwt:
|
||||
secret: "your-jwt-secret-key-change-this-in-production"
|
||||
expire: 7200
|
||||
|
||||
log:
|
||||
level: info
|
||||
filename: logs/app.log
|
||||
maxSize: 100
|
||||
maxAge: 30
|
||||
maxBackups: 5
|
||||
enableConsole: true
|
||||
enableFile: true
|
||||
format: json
|
||||
enableCaller: true
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 1000
|
||||
|
||||
wechat:
|
||||
appId: "your-wechat-appid"
|
||||
appSecret: "your-wechat-appsecret"
|
||||
|
||||
wechatPay:
|
||||
environment: "production"
|
||||
appId: "your-wechat-appid"
|
||||
mchId: "your-merchant-id"
|
||||
apiV3Key: "your-api-v3-key-32-characters"
|
||||
certPath: "certs/apiclient_cert.pem"
|
||||
keyPath: "certs/apiclient_key.pem"
|
||||
serialNo: "your-certificate-serial-number"
|
||||
notifyUrl: "https://yourdomain.com/api/v1/payment/notify"
|
||||
refundNotifyUrl: "https://yourdomain.com/api/refunds/callback"
|
||||
|
||||
# ========== 文件上传配置 ==========
|
||||
upload:
|
||||
maxImageSize: 5242880 # 5MB
|
||||
maxFileSize: 10485760 # 10MB
|
||||
imageTypes: [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
||||
|
||||
# 存储类型选择:
|
||||
# - local: 本地存储(默认)
|
||||
# - oss: 阿里云OSS
|
||||
storageType: "oss"
|
||||
|
||||
# 本地存储配置(storageType为local时使用)
|
||||
staticPath: "./static"
|
||||
baseUrl: "https://yourdomain.com"
|
||||
|
||||
# 阿里云OSS配置(storageType为oss时使用)
|
||||
oss:
|
||||
# OSS访问域名(Endpoint)
|
||||
# 根据你的Bucket所在地域选择:
|
||||
# - 华东1(杭州):oss-cn-hangzhou.aliyuncs.com
|
||||
# - 华东2(上海):oss-cn-shanghai.aliyuncs.com
|
||||
# - 华北1(青岛):oss-cn-qingdao.aliyuncs.com
|
||||
# - 华北2(北京):oss-cn-beijing.aliyuncs.com
|
||||
# - 华南1(深圳):oss-cn-shenzhen.aliyuncs.com
|
||||
# 更多地域请参考:https://help.aliyun.com/document_detail/31837.html
|
||||
endpoint: "oss-cn-hangzhou.aliyuncs.com"
|
||||
|
||||
# AccessKey ID(在阿里云控制台获取)
|
||||
# 建议使用RAM子账号的AccessKey,并授予最小权限
|
||||
accessKeyId: "your-access-key-id"
|
||||
|
||||
# AccessKey Secret(在阿里云控制台获取)
|
||||
accessKeySecret: "your-access-key-secret"
|
||||
|
||||
# Bucket名称(需要提前在OSS控制台创建)
|
||||
bucketName: "your-bucket-name"
|
||||
|
||||
# 文件存储基础路径(可选,建议设置以便文件分类管理)
|
||||
# 例如:dianshang/ 表示所有文件都存储在 dianshang/ 目录下
|
||||
basePath: "dianshang/"
|
||||
|
||||
# 自定义域名(可选)
|
||||
# 如果你配置了CDN加速域名或自定义域名,填写这里
|
||||
# 例如:https://cdn.yourdomain.com
|
||||
# 如果不填写,将使用默认的OSS域名:https://bucket-name.endpoint/
|
||||
domain: ""
|
||||
|
||||
# ========== OSS配置说明 ==========
|
||||
#
|
||||
# 1. 创建OSS Bucket:
|
||||
# - 登录阿里云OSS控制台:https://oss.console.aliyun.com/
|
||||
# - 创建Bucket,选择合适的地域和存储类型
|
||||
# - 设置读写权限为"公共读"(如果需要直接访问)或"私有"(使用签名URL访问)
|
||||
#
|
||||
# 2. 获取AccessKey:
|
||||
# - 访问:https://ram.console.aliyun.com/manage/ak
|
||||
# - 建议创建RAM子账号,只授予OSS相关权限(AliyunOSSFullAccess)
|
||||
# - 获取AccessKey ID和AccessKey Secret
|
||||
#
|
||||
# 3. 配置跨域(CORS):
|
||||
# - 在OSS控制台的Bucket设置中配置CORS规则
|
||||
# - 允许的来源:* 或你的域名
|
||||
# - 允许的方法:GET, POST, PUT, DELETE, HEAD
|
||||
# - 允许的Headers:*
|
||||
#
|
||||
# 4. CDN加速(可选但推荐):
|
||||
# - 在OSS控制台绑定自定义域名
|
||||
# - 开启CDN加速以提升访问速度
|
||||
# - 配置HTTPS证书
|
||||
# - 将domain设置为你的CDN域名
|
||||
#
|
||||
# 5. 切换存储方式:
|
||||
# - 修改 storageType 为 "local" 使用本地存储
|
||||
# - 修改 storageType 为 "oss" 使用阿里云OSS
|
||||
# - 系统支持降级:OSS上传失败时自动切换到本地存储
|
||||
80
server/configs/config.prod-cn.yaml
Normal file
80
server/configs/config.prod-cn.yaml
Normal file
@@ -0,0 +1,80 @@
|
||||
# 生产环境配置 - 中国区
|
||||
server:
|
||||
port: 8060
|
||||
mode: release # debug, release, test
|
||||
|
||||
# 数据库配置 - 中国区生产环境
|
||||
database:
|
||||
driver: mysql
|
||||
host: 8.149.233.36
|
||||
port: 3306
|
||||
username: ai_dianshang
|
||||
password: "7aK_H2yvokVumr84lLNDt8fDBp6P"
|
||||
dbname: ai_dianshang
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
autoMigrate: false # 生产环境禁用自动迁移
|
||||
logLevel: silent # 生产环境关闭GORM SQL日志
|
||||
|
||||
# Redis配置 - 中国区生产环境
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 0
|
||||
|
||||
# JWT配置 - 中国区生产环境
|
||||
jwt:
|
||||
secret: "prod-cn-jwt-secret-key-change-this"
|
||||
expire: 7200
|
||||
|
||||
# 日志配置 - 中国区生产环境
|
||||
log:
|
||||
level: info # debug, info, warn, error
|
||||
filename: logs/app.prod-cn.log
|
||||
maxSize: 200 # MB
|
||||
maxAge: 30 # 天
|
||||
maxBackups: 10 # 保留文件数
|
||||
enableConsole: true # 启用控制台输出
|
||||
enableFile: true
|
||||
format: text # 使用text格式便于查看
|
||||
enableCaller: true
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 2000 # 生产环境更宽松的性能阈值
|
||||
|
||||
# 微信小程序配置 - 中国区生产环境
|
||||
wechat:
|
||||
appId: "wxccc7018b3bfff234"
|
||||
appSecret: "fa5802a24e7dca8a3cf91ad1e2f288e8"
|
||||
|
||||
# 微信支付配置 - 中国区生产环境
|
||||
wechatPay:
|
||||
environment: "production" # sandbox(沙箱) 或 production(生产)
|
||||
appId: "wxccc7018b3bfff234" # 您的真实微信小程序AppID
|
||||
mchId: "1726717114" # 您的真实微信支付商户号
|
||||
apiV3Key: "M2nB4vCxZ7qW8eKrDtA1jHlP5gF3sN9y" # 您的真实APIv3密钥(32位)
|
||||
certPath: "certs/apiclient_cert.pem" # 商户证书路径
|
||||
keyPath: "certs/apiclient_key.pem" # 商户私钥路径
|
||||
serialNo: "26DA8C2BC03B796222DA3FCFC6825B236A8C7538" # 证书序列号
|
||||
notifyUrl: "https://api-cn.your-domain.com/api/v1/payment/notify" # 中国区支付回调地址
|
||||
refundNotifyUrl: "https://api-cn.your-domain.com/api/refunds/callback" # 中国区退款回调地址
|
||||
|
||||
# 文件上传配置 - 中国区生产环境
|
||||
upload:
|
||||
maxImageSize: 5242880 # 5MB (5 * 1024 * 1024)
|
||||
maxFileSize: 10485760 # 10MB (10 * 1024 * 1024)
|
||||
imageTypes: [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
||||
staticPath: "./static"
|
||||
baseUrl: "https://api-cn.your-domain.com"
|
||||
storageType: "oss" # local(本地存储) 或 oss(阿里云OSS)
|
||||
|
||||
# 阿里云OSS配置(中国区)
|
||||
oss:
|
||||
endpoint: "oss-cn-beijing.aliyuncs.com" # 中国北京地域
|
||||
accessKeyId: "LTAI5tNesdhDH4ErqEUZmEg2" # 你的AccessKey ID
|
||||
accessKeySecret: "xZn7WUkTW76TqOLTh01zZATnU6p3Tf" # 你的AccessKey Secret
|
||||
bucketName: "bxmkb-beijing" # 你的Bucket名称
|
||||
basePath: "dianshang/" # 文件存储基础路径
|
||||
domain: "" # 自定义域名(可选,如果有CDN加速域名)
|
||||
80
server/configs/config.prod-eu.yaml
Normal file
80
server/configs/config.prod-eu.yaml
Normal file
@@ -0,0 +1,80 @@
|
||||
# 生产环境配置 - 欧洲区
|
||||
server:
|
||||
port: 8060
|
||||
mode: release # debug, release, test
|
||||
|
||||
# 数据库配置 - 欧洲区生产环境
|
||||
database:
|
||||
driver: mysql
|
||||
host: eu-db.your-domain.com # 欧洲区数据库地址
|
||||
port: 3306
|
||||
username: ai_dianshang_eu
|
||||
password: "your-eu-db-password" # 请替换为实际密码
|
||||
dbname: ai_dianshang
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
autoMigrate: false # 生产环境禁用自动迁移
|
||||
logLevel: silent # 生产环境关闭GORM SQL日志
|
||||
|
||||
# Redis配置 - 欧洲区生产环境
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 0
|
||||
|
||||
# JWT配置 - 欧洲区生产环境
|
||||
jwt:
|
||||
secret: "prod-eu-jwt-secret-key-change-this"
|
||||
expire: 7200
|
||||
|
||||
# 日志配置 - 欧洲区生产环境
|
||||
log:
|
||||
level: info # debug, info, warn, error
|
||||
filename: logs/app.prod-eu.log
|
||||
maxSize: 200 # MB
|
||||
maxAge: 30 # 天
|
||||
maxBackups: 10 # 保留文件数
|
||||
enableConsole: true # 启用控制台输出
|
||||
enableFile: true
|
||||
format: text # 使用text格式便于查看
|
||||
enableCaller: true
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 2000 # 生产环境更宽松的性能阈值
|
||||
|
||||
# 微信小程序配置 - 欧洲区生产环境
|
||||
wechat:
|
||||
appId: "wx_eu_app_id" # 欧洲区小程序AppID
|
||||
appSecret: "eu_app_secret" # 欧洲区小程序AppSecret
|
||||
|
||||
# 微信支付配置 - 欧洲区生产环境
|
||||
wechatPay:
|
||||
environment: "production"
|
||||
appId: "wx_eu_app_id"
|
||||
mchId: "eu_merchant_id"
|
||||
apiV3Key: "eu_api_v3_key"
|
||||
certPath: "certs/eu_apiclient_cert.pem"
|
||||
keyPath: "certs/eu_apiclient_key.pem"
|
||||
serialNo: "eu_serial_no"
|
||||
notifyUrl: "https://api-eu.your-domain.com/api/v1/payment/notify"
|
||||
refundNotifyUrl: "https://api-eu.your-domain.com/api/refunds/callback"
|
||||
|
||||
# 文件上传配置 - 欧洲区生产环境
|
||||
upload:
|
||||
maxImageSize: 5242880 # 5MB
|
||||
maxFileSize: 10485760 # 10MB
|
||||
imageTypes: [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
||||
staticPath: "./static"
|
||||
baseUrl: "https://api-eu.your-domain.com"
|
||||
storageType: "oss"
|
||||
|
||||
# 阿里云OSS配置(欧洲区)
|
||||
oss:
|
||||
endpoint: "oss-eu-central-1.aliyuncs.com" # 欧洲中部地域
|
||||
accessKeyId: "your-eu-access-key-id"
|
||||
accessKeySecret: "your-eu-access-key-secret"
|
||||
bucketName: "your-eu-bucket"
|
||||
basePath: "dianshang/"
|
||||
domain: ""
|
||||
80
server/configs/config.prod-us.yaml
Normal file
80
server/configs/config.prod-us.yaml
Normal file
@@ -0,0 +1,80 @@
|
||||
# 生产环境配置 - 美国区
|
||||
server:
|
||||
port: 8060
|
||||
mode: release # debug, release, test
|
||||
|
||||
# 数据库配置 - 美国区生产环境
|
||||
database:
|
||||
driver: mysql
|
||||
host: 104.244.91.212 # 美国区数据库地址
|
||||
port: 3306
|
||||
username: ai_dianshang
|
||||
password: "7aK_H2yvokVumr84lLNDt8fDBp6P" # 请替换为实际密码
|
||||
dbname: ai_dianshang
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
autoMigrate: false # 生产环境禁用自动迁移
|
||||
logLevel: silent # 生产环境关闭GORM SQL日志
|
||||
|
||||
# Redis配置 - 美国区生产环境
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 0
|
||||
|
||||
# JWT配置 - 美国区生产环境
|
||||
jwt:
|
||||
secret: "prod-us-jwt-secret-key-change-this"
|
||||
expire: 7200
|
||||
|
||||
# 日志配置 - 美国区生产环境
|
||||
log:
|
||||
level: info # debug, info, warn, error
|
||||
filename: logs/app.prod-us.log
|
||||
maxSize: 200 # MB
|
||||
maxAge: 30 # 天
|
||||
maxBackups: 10 # 保留文件数
|
||||
enableConsole: true # 启用控制台输出
|
||||
enableFile: true
|
||||
format: text # 使用text格式便于查看
|
||||
enableCaller: true
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 2000 # 生产环境更宽松的性能阈值
|
||||
|
||||
# 微信小程序配置 - 生产环境
|
||||
wechat:
|
||||
appId: "wxccc7018b3bfff234"
|
||||
appSecret: "fa5802a24e7dca8a3cf91ad1e2f288e8"
|
||||
|
||||
# 微信支付配置 - 开发环境
|
||||
wechatPay:
|
||||
environment: "production" # sandbox(沙箱) 或 production(生产)
|
||||
appId: "wxccc7018b3bfff234" # 您的真实微信小程序AppID
|
||||
mchId: "1726717114" # 您的真实微信支付商户号
|
||||
apiV3Key: "M2nB4vCxZ7qW8eKrDtA1jHlP5gF3sN9y" # 您的真实APIv3密钥(32位)
|
||||
certPath: "certs/apiclient_cert.pem" # 商户证书路径
|
||||
keyPath: "certs/apiclient_key.pem" # 商户私钥路径
|
||||
serialNo: "26DA8C2BC03B796222DA3FCFC6825B236A8C7538" # 证书序列号
|
||||
notifyUrl: "https://vizee.shop/api/v1/payment/notify" # 支付回调地址
|
||||
refundNotifyUrl: "https://vizee.shop/api/refunds/callback" # 退款回调地址
|
||||
|
||||
# 文件上传配置 - 生产环境
|
||||
upload:
|
||||
maxImageSize: 5242880 # 5MB (5 * 1024 * 1024)
|
||||
maxFileSize: 10485760 # 10MB (10 * 1024 * 1024)
|
||||
imageTypes: [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
||||
staticPath: "./static"
|
||||
baseUrl: "http://vizee.shop"
|
||||
storageType: "oss" # local(本地存储) 或 oss(阿里云OSS)
|
||||
|
||||
# 阿里云OSS配置(当storageType为oss时生效)
|
||||
oss:
|
||||
endpoint: "oss-cn-beijing.aliyuncs.com" # OSS访问域名,根据你的地域修改
|
||||
accessKeyId: "LTAI5tNesdhDH4ErqEUZmEg2" # 你的AccessKey ID
|
||||
accessKeySecret: "xZn7WUkTW76TqOLTh01zZATnU6p3Tf" # 你的AccessKey Secret
|
||||
bucketName: "bxmkb-beijing" # 你的Bucket名称
|
||||
basePath: "dianshang/" # 文件存储基础路径
|
||||
domain: "" # 自定义域名(可选,如果有CDN加速域名)
|
||||
@@ -1,65 +0,0 @@
|
||||
# 生产环境微信支付配置示例
|
||||
# 请复制此文件为 config.prod.yaml 并填入真实参数
|
||||
|
||||
server:
|
||||
port: 8080
|
||||
mode: release
|
||||
|
||||
# 数据库配置 - 生产环境
|
||||
database:
|
||||
driver: mysql
|
||||
host: your_db_host
|
||||
port: 3306
|
||||
username: your_db_user
|
||||
password: "your_db_password"
|
||||
dbname: ai_dianshang
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
|
||||
# Redis配置 - 生产环境
|
||||
redis:
|
||||
host: your_redis_host
|
||||
port: 6379
|
||||
password: "your_redis_password"
|
||||
db: 0
|
||||
|
||||
# JWT配置 - 生产环境
|
||||
jwt:
|
||||
secret: "your-production-jwt-secret-key-must-be-complex"
|
||||
expire: 7200
|
||||
|
||||
# 日志配置 - 生产环境
|
||||
log:
|
||||
level: info
|
||||
filename: logs/app.log
|
||||
maxSize: 100
|
||||
maxAge: 30
|
||||
maxBackups: 10
|
||||
enableConsole: true
|
||||
enableFile: true
|
||||
format: json
|
||||
enableCaller: false
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 1000
|
||||
|
||||
# 微信小程序配置 - 生产环境
|
||||
wechat:
|
||||
appId: "wx1234567890abcdef" # 替换为您的真实AppID
|
||||
appSecret: "your_real_app_secret" # 替换为您的真实AppSecret
|
||||
|
||||
# 微信支付配置 - 生产环境
|
||||
wechatPay:
|
||||
appId: "wx1234567890abcdef" # 您的真实微信小程序AppID
|
||||
mchId: "1600000000" # 您的真实微信支付商户号
|
||||
apiKey: "your_real_32_character_api_v3_key_here" # 您的真实APIv3密钥(32位)
|
||||
certPath: "certs/apiclient_cert.pem" # 商户证书路径
|
||||
keyPath: "certs/apiclient_key.pem" # 商户私钥路径
|
||||
notifyUrl: "https://yourdomain.com/api/v1/payment/notify" # 您的真实支付回调URL(必须HTTPS)
|
||||
|
||||
# 重要提醒:
|
||||
# 1. 所有以 "your_" 开头的值都需要替换为真实值
|
||||
# 2. 证书文件需要从微信支付商户平台下载
|
||||
# 3. 回调URL必须是可公网访问的HTTPS地址
|
||||
# 4. 商户号需要通过微信支付商户资质审核获得
|
||||
@@ -36,10 +36,10 @@ log:
|
||||
maxSize: 200 # MB
|
||||
maxAge: 30 # 天
|
||||
maxBackups: 10 # 保留文件数
|
||||
enableConsole: true # 生产环境不输出到控制台
|
||||
enableConsole: true # 启用控制台输出
|
||||
enableFile: true
|
||||
format: json
|
||||
enableCaller: true # 生产环境关闭调用者信息
|
||||
format: text # 使用text格式便于查看
|
||||
enableCaller: true
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 2000 # 生产环境更宽松的性能阈值
|
||||
|
||||
Reference in New Issue
Block a user