Commit bb2971ce authored by 罗超's avatar 罗超

新增配置

parent b19165c0
......@@ -119,14 +119,15 @@
//这里请求接口
var OpenId = "";
that.request2({
url: "/api/mall/GetWeChatOpenId",
url: "/api/mall/GetHPWeChatOpenId",
data: {
Code: obj.code,
},
},
(res) => {
if (res.resultCode == 1) {
obj.OpenId = res.data;
obj.OpenId = res.data.openId;
obj.Unoinid = res.data.unionid
that.getLogin(obj);
}
}
......@@ -159,9 +160,14 @@
UserPageType: Up,
CounponPassword: CounponPassword,
KeyWord: KeyWord,
Unoinid:obj.Unoinid
}
let url = "/api/AppletLogin/Login"
// #ifdef MP-DI
url = "/api/AppletLogin/HPSLLogin"
// #endif
that.request2({
url: "/api/AppletLogin/Login",
url,
data: loginMsg,
},
(res) => {
......
......@@ -69,7 +69,7 @@
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wxcf0727a7c78b501e",
"appid": "wx5564525562e92ddb",
"setting" : {
"urlCheck" : true,
"minified" : false
......
......@@ -4,10 +4,10 @@
},
"uni-app": {
"scripts": {
"mp-direct": {
"mp-direct": {
"title":"直客微信小程序",
"env": {
"UNI_PLATFORM": "mp-weixin"
"UNI_PLATFORM": "mp-weixin"
},
"define": {
"MP-DI": true
......@@ -16,7 +16,7 @@
"mp-agent": {
"title":"同业微信小程序",
"env": {
"UNI_PLATFORM": "mp-weixin"
"UNI_PLATFORM": "mp-weixin"
},
"define": {
"MP-AG": true
......
......@@ -23,9 +23,9 @@ export default {
install(Vue, options) {
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.host2 = "https://erpmallapi.oytour.com"
//Vue.prototype.host2 = "https://erpmallapi.oytour.com"
Vue.prototype.host3 = "https://reborn.oytour.com"
Vue.prototype.request = function(param, success, failed) {
......@@ -317,24 +317,22 @@ export default {
Vue.prototype.GetMiniAppId = function() {
let appObj = {};
let appType = 2;
switch (appType) {
case 1: //旅小友-支付宝
appObj = {
AppId: '2021002181604459',
TenantId: 12,
MallBaseId: 2,
};
break;
case 2: //旅小友-微信
//wx5564525562e92ddb
//wxcf0727a7c78b501e
appObj = {
AppId: 'wxcf0727a7c78b501e',
TenantId: 12,
MallBaseId: 2,
};
break;
}
// #ifdef MP-DI
appObj = {
AppId: 'wx5564525562e92ddb',
TenantId: 29,
MallBaseId: 19,
};
// #endif
// #ifdef MP-AG
appObj = {
AppId: 'wxcf0727a7c78b501e',
TenantId: 12,
MallBaseId: 2,
};
// #endif
return appObj;
}
//获取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