| | |
| | | const res = await this.$store.dispatch('getCurrentInfo'); |
| | | // console.log('init info',res,this.currentInfo) |
| | | if (this.currentInfo && this.currentInfo.id && !this.currentInfo.openId) { |
| | | |
| | | uni.reLaunch({ |
| | | url: '/pages/home/supplier-home' |
| | | }) |
| | |
| | | "quickapp" : {}, |
| | | /* 快应用特有相关 */ |
| | | "mp-weixin" : { |
| | | "appid" : "wx3203fd935a6ffe09", |
| | | "appid" : "wx6d0ecc4e18710458", |
| | | "setting" : { |
| | | "urlCheck" : false, |
| | | "es6" : true, |
对比新文件 |
| | |
| | | const fs = require('fs') |
| | | //此处如果是用HBuilderX创建的项目manifest.json文件在项目跟目录,如果是 cli 创建的则在 src 下,这里要注意 |
| | | //process.env.UNI_INPUT_DIR为项目所在的绝对路径,经测试,相对路径会找不到文件 |
| | | const manifestPath = process.env.UNI_INPUT_DIR + '/manifest.json' |
| | | let Manifest = fs.readFileSync(manifestPath, { encoding: 'utf-8' }) |
| | | function replaceManifest(path, value) { |
| | | const arr = path.split('.') |
| | | const len = arr.length |
| | | const lastItem = arr[len - 1] |
| | | |
| | | let i = 0 |
| | | let ManifestArr = Manifest.split(/\n/) |
| | | |
| | | for (let index = 0; index < ManifestArr.length; index++) { |
| | | const item = ManifestArr[index] |
| | | if (new RegExp(`"${arr[i]}"`).test(item)) ++i; |
| | | if (i === len) { |
| | | const hasComma = /,/.test(item) |
| | | ManifestArr[index] = item.replace(new RegExp(`"${lastItem}"[\\s\\S]*:[\\s\\S]*`), `"${lastItem}": ${value}${hasComma ? ',' : ''}`) |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Manifest = ManifestArr.join('\n') |
| | | } |
| | | //动态配置 h5.router.base ,这部分的代码可根据自己的需要写,需要改什么,按照manifest.json对应的路径写好即可 |
| | | if (process.env.NODE_ENV === 'production') { |
| | | replaceManifest('h5.router.base', '"/game"') |
| | | } |
| | | else if (process.env.NODE_ENV === 'test') { |
| | | replaceManifest('h5.router.base', '"/test/game"') |
| | | } |
| | | else if (process.env.NODE_ENV === 'development') { |
| | | replaceManifest('h5.router.base', '"/dev/game"') |
| | | } |
| | | |
| | | |
| | | |
| | | fs.writeFileSync(manifestPath, Manifest, { |
| | | "flag": "w" |
| | | }) |
| | |
| | | { |
| | | "uni-app": { |
| | | "scripts": { |
| | | "local": { |
| | | "title": "花农/供应商", |
| | | "BROWSER": "Chrome", |
| | | "env": { |
| | | "UNI_PLATFORM": "MP", |
| | | "SERVER_COMMON": "supplier" |
| | | }, |
| | | "define": { |
| | | "H5-SERVERLOCAL": true |
| | | } |
| | | }, |
| | | "common": { |
| | | "title": "一般", |
| | | "BROWSER": "Chrome", |
| | | "env": { |
| | | "UNI_PLATFORM": "MP", |
| | | "SERVER_COMMON": "AAA" |
| | | }, |
| | | "define": { |
| | | "H5-SERVERCOMMON": true |
| | | } |
| | | } |
| | | |
| | | } |
| | | }, |
| | | "dependencies": { |
| | | "moment": "^2.30.1", |
| | | "uview-ui": "^2.0.36" |
| | | }, |
| | | "devDependencies": { |
| | | "sass": "^1.77.6", |
| | | "sass-loader": "^10.5.2" |
| | | } |
| | | {
|
| | | "uni-app": {
|
| | | "scripts": {
|
| | | "supplier": {
|
| | | "title": "花农/供应商-小程序",
|
| | | "BROWSER": "Chrome",
|
| | | "env": {
|
| | | "UNI_PLATFORM": "mp-weixin",
|
| | | "PUB_TYPE": "supplier"
|
| | | },
|
| | | "define": {
|
| | | "PUB_SUPPLIER": true
|
| | | }
|
| | | },
|
| | | "partner": {
|
| | | "title": "合伙人-小程序",
|
| | | "BROWSER": "Chrome",
|
| | | "env": {
|
| | | "UNI_PLATFORM": "mp-weixin",
|
| | | "PUB_TYPE": "partner"
|
| | | },
|
| | | "define": {
|
| | | "PUB_PARTNER": true
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | },
|
| | | "dependencies": {
|
| | | "moment": "^2.30.1",
|
| | | "uview-ui": "^2.0.36"
|
| | | },
|
| | | "devDependencies": {
|
| | | "sass": "^1.77.6",
|
| | | "sass-loader": "^10.5.2"
|
| | | }
|
| | | } |
| | |
| | | apitype: { |
| | | type:String, |
| | | default(){ |
| | | // #ifdef PUB_SUPPLIER |
| | | return 'loginSupplier' |
| | | |
| | | // #endif |
| | | // #ifdef PUB_PARTNER |
| | | return 'loginPartner' |
| | | // #endif |
| | | return '' |
| | | // return 'loginPartner' |
| | | } |
| | | }, |