meixifrontserve 0.3.2 → 0.3.4

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.2",
3
+ "version": "0.3.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "private": false,
@@ -1,4 +1,5 @@
1
1
  const apiConfig = {
2
+ 'dev': "http://meixi.wubangtu.xyz/api",
2
3
  'beta': "http://meixi.wubangtu.xyz/api",
3
4
  "pre": "http://pre.oaadmin.meixioa.com/api",
4
5
  "prod": "https://oaadmin.meixioa.com/api"
@@ -6,6 +7,7 @@ const apiConfig = {
6
7
 
7
8
 
8
9
  const ossBuckConfig = {
10
+ 'dev': 'Web/OA/FrontMicModule/',
9
11
  'beta': 'Web/OA/FrontMicModule/',
10
12
  'pre': 'Web/OA/FrontMicModule/',
11
13
  'prod': 'Web/OA/FrontMicModule/'
@@ -30,7 +30,7 @@ class RollupBuildController {
30
30
  this.rollupBuildTarget = JSON.parse(fs.readFileSync(configPath).toString());
31
31
  let str = ''
32
32
  for (let rollupBuildTargetKey in this.rollupBuildTarget) {
33
- let paramsStr = `${this.rollupBuildTarget[`${rollupBuildTargetKey}`][`source`]}-lib/${rollupBuildTargetKey}.umd.js`
33
+ let paramsStr = `${this.rollupBuildTarget[`${rollupBuildTargetKey}`][`source`]}-lib/${rollupBuildTargetKey}.umd.min.js`
34
34
  if (!str) {
35
35
  str += `${this.checkPlatform()} / --pathTarget ${paramsStr}`
36
36
  } else {
@@ -54,15 +54,19 @@ class RollupBuildController {
54
54
  console.log('开始准备上传文件');
55
55
  const press = process.cwd();
56
56
  for (let rollupBuildTargetKey in this.rollupBuildTarget) {
57
- let configPath = path.join(press, `./lib/${rollupBuildTargetKey}.umd.js`);
57
+ let configPath = path.join(press, `./lib/${rollupBuildTargetKey}.umd.min.js`);
58
58
  let fileContent = fs.readFileSync(configPath);
59
- let ossParams = await this.netApiToAuth();
60
- let ossUrl = await this.netToFileToOss(ossParams, fileContent, rollupBuildTargetKey);
59
+ try {
60
+ let ossParams = await this.netApiToAuth();
61
+ let ossUrl = await this.netToFileToOss(ossParams, fileContent, rollupBuildTargetKey);
61
62
 
62
- if (ossUrl) {
63
- // 调用微模块管理接口
64
- await this.netToMicoModuleAPi(ossUrl, rollupBuildTargetKey)
63
+ if (ossUrl) {
64
+ // 调用微模块管理接口
65
+ await this.netToMicoModuleAPi(ossUrl, rollupBuildTargetKey)
65
66
 
67
+ }
68
+ } catch (error) {
69
+ console.log(error);
66
70
  }
67
71
 
68
72
  }
@@ -85,8 +89,8 @@ class RollupBuildController {
85
89
  const date = new Date();
86
90
  let time = `${date.getFullYear()}${date.getMonth() + 1}${date.getDate()}`
87
91
  return new Promise((resolve, reject) => {
88
- needle.post(`${apiConfig[`${this.env}`]}/api/files/osssource/common/oss/policy`, {
89
- filepath: `${ossBuckConfig[`${this.env}`]}/${time}`
92
+ needle.post(`${apiConfig[`${this.env}`]}/files/osssource/common/oss/policy`, {
93
+ filepath: `${ossBuckConfig[`${this.env}`]}${time}`
90
94
  }, (error, res) => {
91
95
  if (!error) {
92
96
  resolve(res.body.data);
@@ -135,7 +139,7 @@ class RollupBuildController {
135
139
  return new Promise((resolve, reject) => {
136
140
  console.log('开始调用微模块管理接口')
137
141
  const ver = new Date().valueOf();
138
- needle.post(`${apiConfig[`${this.env}`]}/api/admin/client/backlog/front/code/record`, {
142
+ needle.post(`${apiConfig[`${this.env}`]}/admin/client/backlog/front/code/record`, {
139
143
  tag: rollupBuildTargetKey,
140
144
  version: ver,
141
145
  downloadUrl: ossUrl