From 3e0fd03638b4cd6b4793dddafbfbf97a7d3f065c Mon Sep 17 00:00:00 2001 From: czm <2192718639@qq.com> Date: Thu, 8 Dec 2022 22:37:43 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/project.config.json | 5 +++-- config/dev.js | 3 +++ config/pre.js | 1 + config/prod.js | 3 +++ global.d.ts | 3 +++ src/common/constant.ts | 6 +++--- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/build/project.config.json b/build/project.config.json index 42d5f26..b397a5e 100644 --- a/build/project.config.json +++ b/build/project.config.json @@ -1,5 +1,5 @@ { - "miniprogramRoot": "./", + "miniprogramRoot": "", "projectname": "Mall-lymarket", "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "appid": "wx64fe67f111d52457", @@ -31,7 +31,8 @@ }, "disableUseStrict": false, "useCompilerPlugins": false, - "minifyWXML": true + "minifyWXML": true, + "ignoreUploadUnusedFiles": true }, "compileType": "miniprogram", "libVersion": "2.24.5", diff --git a/config/dev.js b/config/dev.js index 28b9106..6a38774 100644 --- a/config/dev.js +++ b/config/dev.js @@ -6,6 +6,9 @@ module.exports = { }, defineConstants: { CURRENT_BASE_URL: '"https://test.zzfzyc.com/lymarket"', + CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://test.zzfzyc.com"', + CURRENT_PAY_H5_CODE_URL: '"https://test.zzfzyc.com/cashier"', + CURRENT_IMG_CND_Prefix: '"https://test.cdn.zzfzyc.com"', }, mini: { // optimizeMainPackage: { diff --git a/config/pre.js b/config/pre.js index 2ed0102..49f069d 100644 --- a/config/pre.js +++ b/config/pre.js @@ -9,6 +9,7 @@ module.exports = { CURRENT_BASE_URL: '"https://pre.zzfzyc.com/lymarket"', CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://pre.zzfzyc.com"', CURRENT_PAY_H5_CODE_URL: '"https://pre.zzfzyc.com/cashier"', + CURRENT_IMG_CND_Prefix: '"https://test.cdn.zzfzyc.com"', }, mini: { optimizeMainPackage: { diff --git a/config/prod.js b/config/prod.js index acf69d0..851b944 100644 --- a/config/prod.js +++ b/config/prod.js @@ -7,6 +7,9 @@ module.exports = { outputRoot: 'build', defineConstants: { CURRENT_BASE_URL: '"https://www.zzfzyc.com/lymarket"', + CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://www.zzfzyc.com"', + CURRENT_PAY_H5_CODE_URL: '"https://www.zzfzyc.com/cashier"', + CURRENT_IMG_CND_Prefix: '"https://cdn.zzfzyc.com"', }, mini: { optimizeMainPackage: { diff --git a/global.d.ts b/global.d.ts index da1d751..bf7cc05 100644 --- a/global.d.ts +++ b/global.d.ts @@ -21,3 +21,6 @@ declare const CURRENT_VERSION: string declare const CURRENT_GITHASH: string declare const CURRENT_ENV: string declare const CURRENT_BASE_URL: string +declare const CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: string +declare const CURRENT_PAY_H5_CODE_URL: string +declare const CURRENT_IMG_CND_Prefix: string diff --git a/src/common/constant.ts b/src/common/constant.ts index 8c53c74..c6bff8e 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -23,10 +23,10 @@ export const GET_UPLOAD_SIGN = '/upyun/getsign' // 请求签名 url export const UPLOAD_CDN_URL = 'https://v0.api.upyun.com/' // cdn -export const IMG_CND_Prefix = CURRENT_ENV.includes('production') ? 'https://cdn.zzfzyc.com' : 'https://test.cdn.zzfzyc.com' +export const IMG_CND_Prefix = CURRENT_IMG_CND_Prefix // 在线支付图片baseUrl -export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('production') ? 'https://www.zzfzyc.com' : 'https://test.zzfzyc.com' +export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_CAP_HTML_TO_IMAGE_BASE_URL // 上传图片视频 export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}` @@ -48,4 +48,4 @@ export const SCENE = { SearchScene: 0, // 商城面料搜索 } // 支付码单跳转链接 -export const PAY_H5_CODE_URL = CURRENT_ENV.includes('production') ? 'https://www.zzfzyc.com/cashier' : 'https://test.zzfzyc.com/cashier' +export const PAY_H5_CODE_URL = CURRENT_PAY_H5_CODE_URL