|
@@ -29,10 +29,25 @@ export default {
|
|
|
const code = res.code === 0 ? "1" : "0"
|
|
|
const postMessage = `?name=${name}&code=${code}`
|
|
|
if (window.wx && window.wx.miniProgram) {
|
|
|
- window.wx && window.wx.miniProgram.postMessage(postMessage);
|
|
|
+ uni.showToast({
|
|
|
+ title: "微信小程序环境",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ window.wx.miniProgram.postMessage(postMessage);
|
|
|
} else if (window.webChannel) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "app环境",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
webChannel.postMessage(postMessage)
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: "其他环境",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });}
|
|
|
})
|
|
|
}, getEnvType() {
|
|
|
if (window.wx && window.wx.miniProgram) {
|