Commit bb2971ce authored by 罗超's avatar 罗超

新增配置

parent b19165c0
...@@ -119,14 +119,15 @@ ...@@ -119,14 +119,15 @@
//这里请求接口 //这里请求接口
var OpenId = ""; var OpenId = "";
that.request2({ that.request2({
url: "/api/mall/GetWeChatOpenId", url: "/api/mall/GetHPWeChatOpenId",
data: { data: {
Code: obj.code, Code: obj.code,
}, },
}, },
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
obj.OpenId = res.data; obj.OpenId = res.data.openId;
obj.Unoinid = res.data.unionid
that.getLogin(obj); that.getLogin(obj);
} }
} }
...@@ -159,9 +160,14 @@ ...@@ -159,9 +160,14 @@
UserPageType: Up, UserPageType: Up,
CounponPassword: CounponPassword, CounponPassword: CounponPassword,
KeyWord: KeyWord, KeyWord: KeyWord,
Unoinid:obj.Unoinid
} }
let url = "/api/AppletLogin/Login"
// #ifdef MP-DI
url = "/api/AppletLogin/HPSLLogin"
// #endif
that.request2({ that.request2({
url: "/api/AppletLogin/Login", url,
data: loginMsg, data: loginMsg,
}, },
(res) => { (res) => {
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
"quickapp" : {}, "quickapp" : {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wxcf0727a7c78b501e", "appid": "wx5564525562e92ddb",
"setting" : { "setting" : {
"urlCheck" : true, "urlCheck" : true,
"minified" : false "minified" : false
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
}, },
"uni-app": { "uni-app": {
"scripts": { "scripts": {
"mp-direct": { "mp-direct": {
"title":"直客微信小程序", "title":"直客微信小程序",
"env": { "env": {
"UNI_PLATFORM": "mp-weixin" "UNI_PLATFORM": "mp-weixin"
}, },
"define": { "define": {
"MP-DI": true "MP-DI": true
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"mp-agent": { "mp-agent": {
"title":"同业微信小程序", "title":"同业微信小程序",
"env": { "env": {
"UNI_PLATFORM": "mp-weixin" "UNI_PLATFORM": "mp-weixin"
}, },
"define": { "define": {
"MP-AG": true "MP-AG": true
......
...@@ -23,9 +23,9 @@ export default { ...@@ -23,9 +23,9 @@ export default {
install(Vue, options) { install(Vue, options) {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285" Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
// Vue.prototype.host2 = "http://192.168.5.46:8300" Vue.prototype.host2 = "http://192.168.5.56:8033"
//Vue.prototype.host3 = "http://192.168.5.46:8501" //Vue.prototype.host3 = "http://192.168.5.46:8501"
Vue.prototype.host2 = "https://erpmallapi.oytour.com" //Vue.prototype.host2 = "https://erpmallapi.oytour.com"
Vue.prototype.host3 = "https://reborn.oytour.com" Vue.prototype.host3 = "https://reborn.oytour.com"
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function(param, success, failed) {
...@@ -317,24 +317,22 @@ export default { ...@@ -317,24 +317,22 @@ export default {
Vue.prototype.GetMiniAppId = function() { Vue.prototype.GetMiniAppId = function() {
let appObj = {}; let appObj = {};
let appType = 2; let appType = 2;
switch (appType) { // #ifdef MP-DI
case 1: //旅小友-支付宝 appObj = {
appObj = { AppId: 'wx5564525562e92ddb',
AppId: '2021002181604459', TenantId: 29,
TenantId: 12, MallBaseId: 19,
MallBaseId: 2, };
}; // #endif
break;
case 2: //旅小友-微信 // #ifdef MP-AG
//wx5564525562e92ddb appObj = {
//wxcf0727a7c78b501e AppId: 'wxcf0727a7c78b501e',
appObj = { TenantId: 12,
AppId: 'wxcf0727a7c78b501e', MallBaseId: 2,
TenantId: 12, };
MallBaseId: 2, // #endif
};
break;
}
return appObj; return appObj;
} }
//获取OpenId //获取OpenId
......
// 导入fs模块
const fs = require('fs')
const manifestPath = `${__dirname}/manifest.json`;
let Manifest = fs.readFileSync(manifestPath, {
encoding: 'utf-8'
})
const ENV_CONFIG = {
'mp-direct':{
'appid':"wx5564525562e92ddb",
},
'mp-agent':{
'appid':"wxcf0727a7c78b501e"
}
}
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')
}
// 读取环境变量内容
const appid = ENV_CONFIG[process.env.UNI_SCRIPT].appid
console.log('新的APPID是:',appid,ENV_CONFIG)
if (appid) {
replaceManifest('mp-weixin.appid', `"${appid}"`)
}
fs.writeFileSync(manifestPath, Manifest, {
flag: 'w'
})
\ No newline at end of file
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
js-md5@^0.7.3:
version "0.7.3"
resolved "https://registry.npmmirror.com/js-md5/-/js-md5-0.7.3.tgz"
integrity sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment