diff --git a/.env b/.env index a8f6152..04b10c7 100644 --- a/.env +++ b/.env @@ -1,4 +1,3 @@ VUE_APP_BASE_URL = https://k8s-horse-gateway.mashibing.cn VUE_APP_STATIC_URL = https://k8s-shop-app.mashibing.cn -#VUE_APP_IM_URL = ws://192.168.10.94:8090 VUE_APP_IM_URL = wss://k8s-horse-gateway.mashibing.cn \ No newline at end of file diff --git a/env.config.js b/env.config.js deleted file mode 100644 index 4ff92fe..0000000 --- a/env.config.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * @Author: ch - * @Date: 2022-05-05 14:40:00 - * @LastEditors: ch - * @LastEditTime: 2022-06-28 10:59:13 - * @Description: 根据git分支生成对应环境的环境变量 - * 开发时如果环境变量换了,可以不用重启服务,直接运行node env.config.js即可 - */ -const fs = require('fs'); -const path = require('path'); - -const envConfig = { - dev : { - // baseUrl: 'https://you-gateway.mashibing.com', - baseUrl: 'https://k8s-horse-gateway.mashibing.cn', - // baseUrl: '', - staticUrl : 'https://k8s-shop-app.mashibing.cn', - // imUrl : 'ws://192.168.10.94:8090' - imUrl : 'wss://k8s-horse-gateway.mashibing.cn' - }, - test : { - baseUrl: 'https://k8s-horse-gateway.mashibing.cn', - staticUrl : 'https://k8s-shop-app.mashibing.cn', - imUrl : 'wss://k8s-horse-gateway.mashibing.cn' - }, - beta : { - baseUrl: 'https://you-gateway.mashibing.com', - staticUrl : 'https://you-app.mashibing.com', - imUrl : 'wss://you-gateway.mashibing.com' - }, - prod : { - baseUrl: 'https://you-gateway.mashibing.com', - staticUrl : 'https://you-app.mashibing.com', - imUrl : 'wss://you-gateway.mashibing.com' - } -} -let curEnvConfig = null; -const argv = global.process.argv; -for(key in envConfig){ - if(argv.includes(`--ENV:${key}`)){ - curEnvConfig = envConfig[key]; - break; - } -} -if(!curEnvConfig){ - curEnvConfig = envConfig.dev; -} -fs.writeFileSync(`${path.resolve(__dirname, './src/common/config')}/env.js`, - `const ENV = ${JSON.stringify(curEnvConfig)}; export default ENV;`); diff --git a/src/common/config/test.js b/src/common/config/test.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/common/router/index.js b/src/common/router/index.js index 8763bd8..ffa4118 100644 --- a/src/common/router/index.js +++ b/src/common/router/index.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-03-18 11:11:05 * @LastEditors: ch - * @LastEditTime: 2022-06-29 21:53:26 + * @LastEditTime: 2022-07-12 18:31:15 * @Description: file content */ import {RouterMount,createRouter} from 'uni-simple-router'; @@ -14,7 +14,8 @@ const router = createRouter({ //全局路由前置守卫 router.beforeEach((to, from, next) => { // 兼容页面刷新body样式丢失问题 - if (document.body) { + // console.log(document); + if (document) { document.body.setAttribute('class', `uni-body ${to.path.replace('/', '').replace(/\//g, '-')}`) } next(); diff --git a/src/common/utils/alipay.js b/src/common/utils/alipay.js index dffee51..9762de1 100644 --- a/src/common/utils/alipay.js +++ b/src/common/utils/alipay.js @@ -2,12 +2,12 @@ * @Author: ch * @Date: 2022-04-29 14:26:10 * @LastEditors: ch - * @LastEditTime: 2022-06-30 16:03:35 + * @LastEditTime: 2022-07-13 10:37:21 * @Description: file content */ import { ApiPostAliH5Pay, ApiPostAliAppPay } from '@/common/api/pay'; -import ENV from '@/common/config/env'; +const ENV = process.env; export const Alipay = async ({orderId})=>{ // #ifdef APP-PLUS @@ -38,7 +38,7 @@ export const Alipay = async ({orderId})=>{ // #ifdef H5 const { error, result } = await ApiPostAliH5Pay({ orderId, - returnUrl : decodeURIComponent(`${ENV.staticUrl}/payResult?orderId=${orderId}&payType=alih5`) + returnUrl : decodeURIComponent(`${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${orderId}&payType=alih5`) }); if(error){ uni.$u.toast(error.message); diff --git a/src/common/utils/im.js b/src/common/utils/im.js index 6e3d54b..f96168c 100644 --- a/src/common/utils/im.js +++ b/src/common/utils/im.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-05-20 11:00:07 * @LastEditors: ch - * @LastEditTime: 2022-06-13 10:11:33 + * @LastEditTime: 2022-07-13 10:37:52 * @Description: file content */ @@ -11,7 +11,7 @@ import { ToAsyncAwait, FormatJsonSearch } from '@/common/utils'; import { ApiGetCurrentUser } from '@/common/api/account'; import { ApiGetSoketTicket } from '@/common/api/im'; import $store from '@/common/store'; -import ENV from '@/common/config/env'; +const ENV = process.env; const Im = new MsbIm({ reconnect: true, @@ -31,7 +31,7 @@ const ImInit = async () => { avatar : $store.state.userInfo.avatar }) await ToAsyncAwait(Im.init({ - url: `${ENV.imUrl}/ws${par}` + url: `${ENV.VUE_APP_IM_URL}/ws${par}` })) }; diff --git a/src/common/utils/pay.js b/src/common/utils/pay.js index 4cb8dd0..6be8fee 100644 --- a/src/common/utils/pay.js +++ b/src/common/utils/pay.js @@ -2,10 +2,9 @@ * @Author: ch * @Date: 2022-05-06 15:33:55 * @LastEditors: ch - * @LastEditTime: 2022-06-15 14:26:16 + * @LastEditTime: 2022-07-13 10:38:34 * @Description: file content */ -import ENV from '@/common/config/env'; import { Wxpay } from './wxpay'; export const pay = ({orderId, openId, payType})=>{ if(payType === 'wxpay'){ diff --git a/src/common/utils/requset.js b/src/common/utils/requset.js index 2ea37e6..61e03ee 100644 --- a/src/common/utils/requset.js +++ b/src/common/utils/requset.js @@ -2,14 +2,14 @@ * @Author: ch * @Date: 2022-03-17 17:42:32 * @LastEditors: ch - * @LastEditTime: 2022-06-29 17:43:49 + * @LastEditTime: 2022-07-13 10:39:07 * @Description: 项目接口请求统一处理器,返回一个需要token和不需要token的请求封装方法 */ import MsbUniRequest from '@/common/plugins/msbUniRequest'; import $store from '@/common/store'; -import ENV from '@/common/config/env'; import { CreateUUID } from '@/common/utils'; +const ENV = process.env; // 获取已有的UUID没则创建一个并保存到locaStorage中下次使用 let uuid = $store.state.uuid @@ -82,7 +82,7 @@ const clearRepeat = (option) =>{ // 不需要token的接口封装 const MsbRequest = new MsbUniRequest(); -MsbRequest.baseUrl = ENV.baseUrl; +MsbRequest.baseUrl = ENV.VUE_APP_BASE_URL; MsbRequest.use('request', (option) => { if(option.header.repeat){ @@ -102,7 +102,7 @@ MsbRequest.use('error', errorIntercept); // 需要token的接口封装 const MsbRequestTk = new MsbUniRequest(); -MsbRequestTk.baseUrl = ENV.baseUrl; +MsbRequestTk.baseUrl = ENV.VUE_APP_BASE_URL; MsbRequestTk.use('request', (option) => { const token = $store.state.token; diff --git a/src/common/utils/utils.js b/src/common/utils/utils.js index 0fb9969..8a5414f 100644 --- a/src/common/utils/utils.js +++ b/src/common/utils/utils.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-03-17 19:15:10 * @LastEditors: ch - * @LastEditTime: 2022-06-22 10:39:15 + * @LastEditTime: 2022-07-13 10:39:35 * @Description: 一些无法归类的公共方法容器 */ @@ -15,7 +15,6 @@ import { formatJsonSearch as FormatJsonSearch } from "js-util-all"; -import ENV from '@/common/config/env'; import {AD_JUMP_TYPE} from '@/common/dicts/ad'; /** 防抖函数 diff --git a/src/common/utils/wxpay.js b/src/common/utils/wxpay.js index 7609196..74b2689 100644 --- a/src/common/utils/wxpay.js +++ b/src/common/utils/wxpay.js @@ -2,12 +2,12 @@ * @Author: ch * @Date: 2022-04-29 14:26:10 * @LastEditors: ch - * @LastEditTime: 2022-06-29 17:17:40 + * @LastEditTime: 2022-07-13 10:40:10 * @Description: file content */ import { ApiPostWxH5Pay, ApiPostWxJsApiPay, ApiPostWxAppPay } from '@/common/api/pay'; -import ENV from '@/common/config/env'; +const ENV = process.env; export const Wxpay = async ({orderId,openId})=>{ // #ifdef APP-PLUS @@ -74,7 +74,7 @@ export const Wxpay = async ({orderId,openId})=>{ uni.$u.toast(error.message); return false; } - const redirect_url = decodeURIComponent(`${ENV.staticUrl}/payResult?orderId=${orderId}&payType=wxh5`); + const redirect_url = decodeURIComponent(`${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${orderId}&payType=wxh5`); window.location.href = `${result.payDataInfo.h5Url}&redirect_url=${redirect_url}`; } // #endif diff --git a/src/pages.json b/src/pages.json index 9862ef8..00f313f 100644 --- a/src/pages.json +++ b/src/pages.json @@ -14,7 +14,7 @@ "path": "pages/webView", "aliasPath" : "/webView", "style": { - "navigationBarTitleText": "马士兵严选" + "navigationBarTitleText": "收银台" } }, { diff --git a/src/pages/order/detail/modules/Operation.vue b/src/pages/order/detail/modules/Operation.vue index 5e218c5..4b78d53 100644 --- a/src/pages/order/detail/modules/Operation.vue +++ b/src/pages/order/detail/modules/Operation.vue @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-04-15 17:46:10 * @LastEditors: ch - * @LastEditTime: 2022-06-29 20:39:45 + * @LastEditTime: 2022-07-13 14:13:24 * @Description: file content -->