meixifrontserve 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixifrontserve",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "private": false,
@@ -0,0 +1,19 @@
1
+ const apiConfig = {
2
+ 'beta': "http://meixi.wubangtu.xyz/api",
3
+ "pre": "http://pre.oaadmin.meixioa.com/api",
4
+ "prod": "https://oaadmin.meixioa.com/api"
5
+ }
6
+
7
+
8
+ const ossBuckConfig = {
9
+ 'beta': 'Web/OA/FrontMicModule/',
10
+ 'pre': 'Web/OA/FrontMicModule/',
11
+ 'prod': 'Web/OA/FrontMicModule/'
12
+ }
13
+
14
+
15
+ module.exports = {
16
+ apiConfig,
17
+ ossBuckConfig
18
+ }
19
+
@@ -5,6 +5,7 @@ const fs = require("fs");
5
5
  const child_process = require("child_process");
6
6
  const needle = require("needle");
7
7
  const {error} = require("shelljs");
8
+ const {apiConfig, ossBuckConfig} = require("./apiConfig");
8
9
 
9
10
  class RollupBuildController {
10
11
  constructor(env) {
@@ -64,7 +65,6 @@ class RollupBuildController {
64
65
 
65
66
  }
66
67
 
67
-
68
68
  }
69
69
  } else {
70
70
  //
@@ -85,8 +85,8 @@ class RollupBuildController {
85
85
  const date = new Date();
86
86
  let time = `${date.getFullYear()}${date.getMonth() + 1}${date.getDate()}`
87
87
  return new Promise((resolve, reject) => {
88
- needle.post('http://meixi.wubangtu.xyz/api/files/osssource/common/oss/policy', {
89
- filepath: `Web/OA/${time}`
88
+ needle.post(`${apiConfig[`${this.env}`]}/api/files/osssource/common/oss/policy`, {
89
+ filepath: `${ossBuckConfig[`${this.env}`]}/${time}`
90
90
  }, (error, res) => {
91
91
  if (!error) {
92
92
  resolve(res.body.data);
@@ -135,7 +135,7 @@ class RollupBuildController {
135
135
  return new Promise((resolve, reject) => {
136
136
  console.log('开始调用微模块管理接口')
137
137
  const ver = new Date().valueOf();
138
- needle.post('http://meixi.wubangtu.xyz/api/admin/client/backlog/front/code/record', {
138
+ needle.post(`${apiConfig[`${this.env}`]}/api/admin/client/backlog/front/code/record`, {
139
139
  tag: rollupBuildTargetKey,
140
140
  version: ver,
141
141
  downloadUrl: ossUrl