From 16b0d457fc9e81bf4a14da0dca476ac091145681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E5=BE=88=E5=B7=AE=E5=95=A6?= <17633066053@163.com> Date: Fri, 31 Mar 2023 18:16:33 +0800 Subject: [PATCH] =?UTF-8?q?style:=20:sparkles:=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A=20?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=96=B0=E5=A2=9E=E9=83=A8=E5=88=86=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im/src/config/config.js | 28 +++++++++++-- im/src/main.js | 20 ++++++++- .../setting-manage/setting/BASE_SETTING.vue | 12 +++++- .../setting-manage/setting/GOODS_SETTING.vue | 1 + .../sys/setting-manage/setting/IM_SETTING.vue | 2 + .../sys/setting-manage/setting/style.scss | 5 +++ seller/src/views/shop/bill/billDetail.vue | 41 +++++++++++-------- seller/src/views/shop/shopSetting.vue | 14 ++++++- 8 files changed, 96 insertions(+), 27 deletions(-) diff --git a/im/src/config/config.js b/im/src/config/config.js index 7cc7377c..d5396129 100644 --- a/im/src/config/config.js +++ b/im/src/config/config.js @@ -1,10 +1,30 @@ + +/** + * 读取公共配置API路径。 + * 工程会读取根目录下的 env 。 + * 根目录下的.env文件是用来定义环境变量的。 + * 它可以包含各种键值对,每个键代表一个环境变量。 + * 这些环境变量可以在应用程序的整个生命周期内使用,例如在代码中访问、配置webpack或在构建部署过程中使用不同的值。 + * env中的 ODE_ENV指定当前的环境。 + * 可以分别创建.env.development、.env.production等文件。 + * 默认.env 文件中的变量作为开发环境的环境变量。 + * env文件修改的话需要重新编译项目。 + */ export default { + // 网站名称 WEBSITE_NAME: process.env.VUE_APP_WEBSITE_NAME || "LiLi IM", - BASE_API_URL: process.env.VUE_APP_API_BASE_URL || "", - BASE_WS_URL: process.env.VUE_APP_WEB_SOCKET_URL || "", - BASE_COMMON: process.env.VUE_APP_COMMON || "", - BASE_BUYER: process.env.VUE_APP_BUYER || "", + // 默认请求IM的API + BASE_API_URL: process.env.VUE_APP_API_BASE_URL || "", + // 默认请求的WS + BASE_WS_URL: process.env.VUE_APP_WEB_SOCKET_URL || "", + // 默认请求公有接口相关 API + BASE_COMMON: process.env.VUE_APP_COMMON || "", + // 默认请求用户相关API + BASE_BUYER: process.env.VUE_APP_BUYER || "", + // 默认请求卖家相关的API BASE_SELLER: process.env.VUE_APP_SELLER || "", + // 点击商品跳转到的地址 PC_URL: process.env.VUE_APP_PC_URL || "https://pc-b2b2c.pickmall.cn", + // 订单跳转商家订单页面 PC_STORE: process.env.VUE_APP_PC_STORE || 'https://store-b2b2c.pickmall.cn', }; diff --git a/im/src/main.js b/im/src/main.js index 321eab3a..2fdf7f6c 100644 --- a/im/src/main.js +++ b/im/src/main.js @@ -1,20 +1,33 @@ import 'core-js/stable' import 'regenerator-runtime/runtime' +// 引入 Vue 和应用程序组件 import Vue from 'vue' import App from '@/App' + +// 引入 store 和 router import store from '@/store' import router from '@/router' + +// 引入自定义的 mixin import MainMixin from './mixins/main-mixin' + +// 引入全局组件 import face from '@/components/face' import faceNull from '@/components/face-null' + +// 引入配置文件和其他核心模块 import config from "@/config/config"; import './core/lazy-use' import './core/global-component' import './core/filter' import './core/directives' + +// 引入权限控制和图标库 import '@/permission' import '@/icons' + +// 引入自定义过滤器,并注册为全局过滤器 import * as filters from "./plugins/filters"; Object.keys(filters).forEach((key) => { Vue.filter(key, filters[key]); @@ -23,11 +36,16 @@ Object.keys(filters).forEach((key) => { // 引入自定义全局css import '@/assets/css/global.less' +// 关闭生产提示 Vue.config.productionTip = false -Vue.mixin(MainMixin) // 引入mixins + +// 注册全局 mixin +Vue.mixin(MainMixin) Vue.component('face', face) Vue.component('face-null', faceNull) + +// 添加自定义原型方法 Vue.prototype.linkToGoods = function (goodsId, skuId) { // 跳转买家端商品 if (localStorage.getItem('storeFlag') == 'false') { window.open(`${config.PC_URL}goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank') diff --git a/manager/src/views/sys/setting-manage/setting/BASE_SETTING.vue b/manager/src/views/sys/setting-manage/setting/BASE_SETTING.vue index f0675d31..f36647e9 100644 --- a/manager/src/views/sys/setting-manage/setting/BASE_SETTING.vue +++ b/manager/src/views/sys/setting-manage/setting/BASE_SETTING.vue @@ -3,7 +3,8 @@