Compare commits
No commits in common. "c5407b3070bfe0629e4c564f93838c402e1df758" and "d708ef7d2995d842127bb4c15282b4efbe43316f" have entirely different histories.
c5407b3070
...
d708ef7d29
18
index.html
18
index.html
|
@ -32,14 +32,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
// var ctx = 'http://192.168.26.198:3000';
|
// var host = 'http://192.168.26.198:10089';
|
||||||
var ctx = '/epi-project'
|
var ctx = '/epi-project'
|
||||||
var app = new Vue({
|
var app = new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
data: {
|
data: {
|
||||||
tenantList: [],
|
tenantList: [],
|
||||||
selectedTenant: null,
|
selectedTenant: null
|
||||||
isMiniProgram: false
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selChange(tenant) {
|
selChange(tenant) {
|
||||||
|
@ -49,28 +48,23 @@
|
||||||
opacity: 'toggle'
|
opacity: 'toggle'
|
||||||
})
|
})
|
||||||
localStorage.setItem('tenant', tenant.identifier);
|
localStorage.setItem('tenant', tenant.identifier);
|
||||||
if (this.isMiniProgram) {
|
wx.miniProgram.getEnv(function(res) {
|
||||||
|
if (res.miniprogram) {
|
||||||
wx.miniProgram.postMessage({
|
wx.miniProgram.postMessage({
|
||||||
data: {
|
data: {
|
||||||
tenant: tenant.identifier
|
tenant: tenant.identifier
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
}
|
||||||
|
});
|
||||||
// 跳转业务系统
|
// 跳转业务系统
|
||||||
location.href = '/'
|
location.href = '/'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
fetch(ctx + '/tenants').then(r => r.json()).then(res => {
|
fetch(ctx + '/tenants').then(r => r.json()).then(res => {
|
||||||
this.tenantList = res.data;
|
this.tenantList = res.data;
|
||||||
})
|
})
|
||||||
if (!window.WeixinJSBridge || !WeixinJSBridge.invoke) {
|
|
||||||
document.addEventListener('WeixinJSBridgeReady', () => {
|
|
||||||
this.isMiniProgram = window.__wxjs_environment === 'miniprogram'
|
|
||||||
}, false)
|
|
||||||
}
|
|
||||||
this.isMiniProgram = window.__wxjs_environment === 'miniprogram'
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Reference in New Issue