From 791e99057cdace061a7211f9b5eae7e353093cd5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 28 Apr 2025 23:01:34 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9AH5=20=E8=AE=BF=E9=97=AE=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=EF=BC=8C=E6=94=B9=E4=B8=BA=20.env=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 3 +++ sheep/config/index.js | 2 ++ sheep/helper/utils.js | 1 - sheep/store/app.js | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 932f83dd..81b9910a 100644 --- a/.env +++ b/.env @@ -24,6 +24,9 @@ SHOPRO_DEV_PORT=3000 SHOPRO_STATIC_URL=http://test.yudao.iocoder.cn ### SHOPRO_STATIC_URL = https://file.sheepjs.com +# 前端 H5 访问域名 +SHOPRO_H5_URL=http://127.0.0.1:3000 + # 是否开启直播 1 开启直播 | 0 关闭直播 SHOPRO_MPLIVE_ON=0 diff --git a/sheep/config/index.js b/sheep/config/index.js index c365ce48..803558c7 100644 --- a/sheep/config/index.js +++ b/sheep/config/index.js @@ -19,6 +19,7 @@ export const apiPath = import.meta.env.SHOPRO_API_PATH; export const staticUrl = import.meta.env.SHOPRO_STATIC_URL; export const tenantId = import.meta.env.SHOPRO_TENANT_ID; export const websocketPath = import.meta.env.SHOPRO_WEBSOCKET_PATH; +export const h5Url = import.meta.env.SHOPRO_H5_URL; export default { baseUrl, @@ -26,4 +27,5 @@ export default { staticUrl, tenantId, websocketPath, + h5Url, }; diff --git a/sheep/helper/utils.js b/sheep/helper/utils.js index aabf7e9f..0b7a7338 100644 --- a/sheep/helper/utils.js +++ b/sheep/helper/utils.js @@ -309,4 +309,3 @@ export function jsonParse(str) { return str; } } -// TODO @芋艿:融合下; diff --git a/sheep/store/app.js b/sheep/store/app.js index c7c4acbc..10ff6989 100644 --- a/sheep/store/app.js +++ b/sheep/store/app.js @@ -4,7 +4,7 @@ import $platform from '@/sheep/platform'; import $router from '@/sheep/router'; import user from './user'; import sys from './sys'; -import { baseUrl } from '@/sheep/config'; +import { baseUrl, h5Url } from '@/sheep/config'; const app = defineStore({ id: 'app', @@ -78,7 +78,7 @@ const app = defineStore({ this.platform = { share: { methods: ['forward', 'poster', 'link'], - linkAddress: 'http://127.0.0.1:3000', // TODO 芋艿:可以考虑改到 .env 那 + linkAddress: h5Url, posterInfo: { user_bg: '/static/img/shop/config/user-poster-bg.png', goods_bg: '/static/img/shop/config/goods-poster-bg.png',