修改打包命令

merge-requests/1/head
ch 2 years ago
parent 9403e17b29
commit e99accc36b

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-05 14:40:00
* @LastEditors: ch
* @LastEditTime: 2022-05-07 10:09:54
* @LastEditTime: 2022-05-07 10:51:53
* @Description: 根据git分支生成对应环境的环境变量
* 开发时如果环境变量换了可以不用重启服务直接运行node env.config.js即可
*/
@ -25,21 +25,16 @@ const envConfig = {
}
}
const branch = getRepoInfo().branch; // 调用获取git信息
let curEnvConfig = {};
switch (branch){
case 'msb_test':
curEnvConfig = envConfig.test;
break;
case 'msb_beta':
curEnvConfig = envConfig.beta;
break;
case 'msb_prod':
curEnvConfig = envConfig.prod;
break;
default:
curEnvConfig = envConfig.dev;
break;
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, './plugins/config')}/env.js`,
`const ENV = ${JSON.stringify(curEnvConfig)}; export default ENV;`);

@ -4,7 +4,11 @@
"private": true,
"scripts": {
"dev": "node env.config.js & nuxt",
"build": "node env.config.js & nuxt build",
"dev:beta": "node env.config.js --ENV:beta & nuxt",
"dev:prod": "node env.config.js --ENV:prod & nuxt",
"build:test": "node env.config.js --ENV:test & nuxt build",
"build:beta": "node env.config.js --ENV:beta & nuxt build",
"build:prod": "node env.config.js --ENV:prod & nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"test": "jest"

@ -2,14 +2,16 @@
* @Author: ch
* @Date: 2022-05-04 18:24:03
* @LastEditors: ch
* @LastEditTime: 2022-05-04 22:43:19
* @LastEditTime: 2022-05-07 10:27:01
* @Description: file content
*/
import {axiosTk} from "../axiosTk";
import {axios} from "../axios";
import { ToAsyncAwait } from "../utils";
import ENV from '../config/env';
const BASE_URL = `${ENV.base_url}/uc`;
const BASE_URL = '/uc';
/**
* 获取当前登录用户信息
*/

@ -2,14 +2,16 @@
* @Author: ch
* @Date: 2022-05-04 18:24:03
* @LastEditors: ch
* @LastEditTime: 2022-05-04 22:42:08
* @LastEditTime: 2022-05-07 10:28:22
* @Description: file content
*/
import {axiosTk} from "../axiosTk";
import { ToAsyncAwait } from "../utils";
import ENV from '../config/env';
const BASE_URL = `${ENV.base_url}/mall/base`;
const BASE_URL = '/mall/base';
/**
* 获取收货地址
*/

@ -2,13 +2,15 @@
* @Author: ch
* @Date: 2022-05-04 18:24:03
* @LastEditors: ch
* @LastEditTime: 2022-05-04 22:41:25
* @LastEditTime: 2022-05-07 10:29:08
* @Description: file content
*/
import {axiosTk} from "../axiosTk";
import { ToAsyncAwait } from "../utils";
import ENV from '../config/env';
const BASE_URL = `${ENV.base_url}/mall/product`;
const BASE_URL = '/mall/product';
/**
* 设置购物车数量

@ -2,13 +2,15 @@
* @Author: ch
* @Date: 2022-05-04 18:24:03
* @LastEditors: ch
* @LastEditTime: 2022-05-04 22:40:26
* @LastEditTime: 2022-05-07 10:29:22
* @Description: file content
*/
import {axios} from "../axios";
import { ToAsyncAwait } from "../utils";
import ENV from '../config/env';
const BASE_URL = `${ENV.base_url}/mall/product`;
const BASE_URL = '/mall/product';
/**
* 获取商品瀑布流
* @param {*} params

@ -4,12 +4,14 @@
* @Author: ch
* @Date: 2022-05-04 18:17:25
* @LastEditors: ch
* @LastEditTime: 2022-05-04 22:46:02
* @LastEditTime: 2022-05-07 10:29:48
* @Description: file content
*/
import {axiosTk} from "../axiosTk";
import ENV from '../config/env';
const BASE_URL = `${ENV.base_url}/mall/trade`;
const BASE_URL = '/mall/trade';
const APPID = 'wx0643970a8e86d028';
/**

@ -2,14 +2,19 @@
* @Author: ch
* @Date: 2022-05-04 18:24:03
* @LastEditors: ch
* @LastEditTime: 2022-05-04 22:40:06
* @LastEditTime: 2022-05-07 10:30:17
* @Description: file content
*/
import {axiosTk} from "../axiosTk";
import { ToAsyncAwait } from "../utils";
import ENV from '../config/env';
const BASE_URL = '/oss/oss';
const BASE_URL = `${ENV.base_url}/oss/oss`;
/**
* 获取OOS信息
* @param {*} data
*/
export const ApiPostGetOssConfig = (data) =>
ToAsyncAwait(axiosTk.post(`${BASE_URL}/generateOssSignature`, data));

@ -2,13 +2,14 @@
* @Author: ch
* @Date: 2022-05-04 18:24:03
* @LastEditors: ch
* @LastEditTime: 2022-05-04 22:44:12
* @LastEditTime: 2022-05-07 10:30:28
* @Description: file content
*/
import {axios} from "../axios";
import { ToAsyncAwait } from "../utils";
import ENV from '../config/env';
const BASE_URL = '/mall/marketing';
const BASE_URL = `${ENV.base_url}/mall/marketing`;
export const ApiGetHomeSeckill = () =>
ToAsyncAwait(axios.get(`${BASE_URL}/app/activity/home`));

Loading…
Cancel
Save