Commit 07891c22 by 程智春

5.26

parent 609814e2
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
{ {
"extEnable":true, "extEnable":true,
"extAppid":"wxae95a07ffdf11548", "extAppid":"wxae95a07ffdf11548",
"directCommit":true "ext":{
"mixid":"antgood"
}
} }
\ No newline at end of file
<script> <script>
export default { export default {
created () { created () {
let extConfig = wx.getExtConfigSync? wx.getExtConfigSync(): {}
this.$store.commit("setExtConfig", extConfig.mixid);
// if (wx.getExtConfig) {
// wx.getExtConfig({
// success : (res) => {
// if(res.errMsg == 'getExtConfig: ok'){
// this.$store.commit("setExtConfig", res.extConfig.mixid);
// }
// }
// })
// }
// 调用API从本地缓存中获取数据 // 调用API从本地缓存中获取数据
/* /*
* 平台 api 差异的处理方式: api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串 * 平台 api 差异的处理方式: api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串
......
...@@ -11,7 +11,7 @@ import { serialize, getQueryVariable, DFSImg } from "@/utils/index"; ...@@ -11,7 +11,7 @@ import { serialize, getQueryVariable, DFSImg } from "@/utils/index";
export default { export default {
data() { data() {
return { return {
shopId: process.env.SHOP_MIXID, shopId: this.$store.state.mixid,
options: {}, options: {},
session_key: "", session_key: "",
baseUrl: process.env.BASE_URL, baseUrl: process.env.BASE_URL,
...@@ -53,7 +53,8 @@ export default { ...@@ -53,7 +53,8 @@ export default {
"index------", "index------",
this.shopId, this.shopId,
"-----", "-----",
wx.getStorageSync("openid") wx.getStorageSync("openid"),
this.shopId
); );
//检测登录态 //检测登录态
this.checkLogin(); this.checkLogin();
......
...@@ -114,8 +114,6 @@ export default { ...@@ -114,8 +114,6 @@ export default {
code : '', code : '',
shopId: process.env.SHOP_MIXID,
baseUrl: process.env.BASE_URL,
} }
......
...@@ -32,6 +32,9 @@ const mutations = { ...@@ -32,6 +32,9 @@ const mutations = {
wx.clearStorage() wx.clearStorage()
state.isLogin = 0; state.isLogin = 0;
state.userInfo = null; state.userInfo = null;
},
setExtConfig(state,obj){
state.mixid = obj
} }
}; };
......
...@@ -20,5 +20,7 @@ const state = { ...@@ -20,5 +20,7 @@ const state = {
offlineShopCode:"", offlineShopCode:"",
isLogin, isLogin,
userInfo, userInfo,
mixid : '',
}; };
export default state export default state
\ No newline at end of file
import store from '../store/index' import store from '../store/index'
let shopMixid = process.env.SHOP_MIXID;
console.log(store.state.mixid,'store.state')
let shopMixid = store.state.mixid;
// wx.getStore // wx.getStore
export async function requestGET(url, options) { export async function requestGET(url, options) {
......
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