Selaa lähdekoodia

fix: 修改版本引入位置

sh 1 vuosi sitten
vanhempi
commit
e698b3999b
5 muutettua tiedostoa jossa 17 lisäystä ja 6 poistoa
  1. 1 1
      ci/jenkins/Jenkinsfile
  2. 3 0
      config/env.ts
  3. 1 1
      config/index.ts
  4. 1 0
      package.json
  5. 11 4
      src/services/http/api.js

+ 1 - 1
ci/jenkins/Jenkinsfile

@@ -12,7 +12,7 @@ pipeline {
 
          stage('Build & Deploy') {
             steps {
-                sh 'pnpm run build:weapp -- --upload'
+                sh 'pnpm run build_and_upload:weapp'
             }
          }
     }

+ 3 - 0
config/env.ts

@@ -0,0 +1,3 @@
+
+export const APP_VERSION = '1.0.0'
+export const WX_VERSION = '1.4.1'

+ 1 - 1
config/index.ts

@@ -1,6 +1,6 @@
 import path from 'path';
 
-import { WX_VERSION } from '../src/services/http/api';
+import { WX_VERSION } from './env';
 
 const CIPluginFn = {
   weapp: {

+ 1 - 0
package.json

@@ -10,6 +10,7 @@
 	},
 	"scripts": {
 		"build:weapp": "taro build --type weapp",
+        "build_and_upload:weapp": "taro build --type weapp --upload",
 		"build:swan": "taro build --type swan",
 		"build:alipay": "taro build --type alipay",
 		"build:tt": "taro build --type tt",

+ 11 - 4
src/services/http/api.js

@@ -1,7 +1,14 @@
-let online = process.env.TARO_ENV == 'rn' ? false : false;
-export let baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
-export let APP_VERSION = '1.0.0'
-export let WX_VERSION = '1.4.1'
+const online = process.env.TARO_ENV == 'rn' ? false : false;
+
+import { WX_VERSION as _WX_VERSION, APP_VERSION as _APP_VERSION } from "../../../config/env";
+
+export const baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
+// export const APP_VERSION = '1.0.0'
+// export const WX_VERSION = '1.4.1'
+
+export const APP_VERSION = _APP_VERSION
+export const WX_VERSION = _WX_VERSION
+
 export let imgUrl = online
     ? 'https://api.fast.liveplus.fun/static/image/'
     : 'https://api.fast.dev.liveplus.fun/static/image/';