@dcloudio/vue-cli-plugin-uni 2.0.1-alpha-35220220715001 → 2.0.1-alpha-35220220719002

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.
@@ -104,8 +104,8 @@ module.exports = function chainWebpack (platformOptions, vueOptions, api) {
104
104
  'process.env.UNICLOUD_DEBUG': process.env.UNICLOUD_DEBUG,
105
105
  'process.env.RUN_BY_HBUILDERX': process.env.RUN_BY_HBUILDERX,
106
106
  'process.env.UNI_AUTOMATOR_WS_ENDPOINT': JSON.stringify(process.env.UNI_AUTOMATOR_WS_ENDPOINT),
107
- 'process.env.UNI_STAT_UNI_CLOUD': process.env.UNI_STAT_UNI_CLOUD || '',
108
- 'process.env.UNI_STAT_DEBUG': process.env.UNI_STAT_DEBUG || '',
107
+ 'process.env.UNI_STAT_UNI_CLOUD': process.env.UNI_STAT_UNI_CLOUD || '""',
108
+ 'process.env.UNI_STAT_DEBUG': process.env.UNI_STAT_DEBUG || '""',
109
109
  'process.env.UNI_COMPILER_VERSION': JSON.stringify(process.env.UNI_COMPILER_VERSION),
110
110
  'process.env.UNI_APP_VERSION_NAME': JSON.stringify(process.env.UNI_APP_VERSION_NAME),
111
111
  'process.env.UNI_APP_VERSION_CODE': JSON.stringify(process.env.UNI_APP_VERSION_CODE)
package/lib/env.js CHANGED
@@ -21,7 +21,7 @@ if (process.env.UNI_INPUT_DIR && process.env.UNI_INPUT_DIR.indexOf('./') === 0)
21
21
  process.env.UNI_INPUT_DIR = process.env.UNI_INPUT_DIR || path.resolve(process.cwd(), defaultInputDir)
22
22
 
23
23
  const {
24
- getManifestJson,
24
+ getManifestJson,
25
25
  isEnableUniPushV1,
26
26
  isEnableUniPushV2,
27
27
  isUniPushOffline
@@ -66,8 +66,6 @@ process.env.VUE_APP_NAME = manifestJsonObj.name
66
66
 
67
67
  process.env.UNI_USING_V3_SCOPED = true
68
68
 
69
- process.env.UNI_CLOUD_PROVIDER = JSON.stringify([])
70
-
71
69
  // 导出到小程序插件
72
70
  process.env.UNI_MP_PLUGIN_EXPORT = JSON.stringify(Object.keys(platformOptions.plugins || {}).map(pluginName =>
73
71
  platformOptions.plugins[pluginName].export))
@@ -75,7 +73,9 @@ process.env.UNI_MP_PLUGIN_EXPORT = JSON.stringify(Object.keys(platformOptions.pl
75
73
  const isH5 = !process.env.UNI_SUB_PLATFORM && process.env.UNI_PLATFORM === 'h5'
76
74
  const isProduction = process.env.NODE_ENV === 'production'
77
75
 
78
- if (process.env.UNI_CLOUD_SPACES) {
76
+ // uniCloud
77
+ if (!process.env.UNI_CLOUD_PROVIDER && process.env.UNI_CLOUD_SPACES) {
78
+ process.env.UNI_CLOUD_PROVIDER = JSON.stringify([])
79
79
  try {
80
80
  const spaces = JSON.parse(process.env.UNI_CLOUD_SPACES)
81
81
  if (Array.isArray(spaces)) {
@@ -561,4 +561,4 @@ runByHBuilderX && console.log(uniI18n.__('compiling'))
561
561
 
562
562
  module.exports = {
563
563
  manifestPlatformOptions: platformOptions
564
- }
564
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-uni",
3
- "version": "2.0.1-alpha-35220220715001",
3
+ "version": "2.0.1-alpha-35220220719002",
4
4
  "description": "uni-app plugin for vue-cli 3",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "author": "fxy060608",
18
18
  "license": "Apache-2.0",
19
19
  "dependencies": {
20
- "@dcloudio/uni-stat": "^2.0.1-alpha-35220220715001",
20
+ "@dcloudio/uni-stat": "^2.0.1-alpha-35220220719002",
21
21
  "buffer-json": "^2.0.0",
22
22
  "clone-deep": "^4.0.1",
23
23
  "copy-webpack-plugin": "^5.1.1",
@@ -39,5 +39,5 @@
39
39
  "wrap-loader": "^0.2.0",
40
40
  "xregexp": "4.0.0"
41
41
  },
42
- "gitHead": "7a3d8f9a6ef56cf82b0ef5c5a36b4cae6103df3f"
42
+ "gitHead": "6f2fdbfa632fd7b9da6cbdf4faea5ac863f0eb67"
43
43
  }
@@ -4,14 +4,22 @@ uni.invokePushCallback({
4
4
  });
5
5
  Promise.resolve().then(() => {
6
6
  plus.push.setAutoNotification && plus.push.setAutoNotification(false);
7
- const info = plus.push.getClientInfo();
8
- if (info.clientid) {
7
+ plus.push.getClientInfoAsync((info) => {
8
+ if (info.clientid) {
9
+ // @ts-expect-error
10
+ uni.invokePushCallback({
11
+ type: 'clientId',
12
+ cid: info.clientid,
13
+ });
14
+ }
15
+ }, (res) => {
9
16
  // @ts-expect-error
10
17
  uni.invokePushCallback({
11
18
  type: 'clientId',
12
- cid: info.clientid,
19
+ cid: '',
20
+ errMsg: res.code + ': ' + res.message,
13
21
  });
14
- }
22
+ });
15
23
  plus.push.addEventListener('click', (result) => {
16
24
  // @ts-expect-error
17
25
  uni.invokePushCallback({