Commit d6c147c3 authored by ziyu's avatar ziyu

docs: 代码暂存

parent d5b8ee06
...@@ -32,11 +32,6 @@ wepy.app({ ...@@ -32,11 +32,6 @@ wepy.app({
// store.dispatch('setUserInfo',res.userInfo); // store.dispatch('setUserInfo',res.userInfo);
}) })
} }
},
fail: ()=> {
wx.reLaunch({
url: '/pages/auth',
})
} }
}) })
}else{ }else{
...@@ -55,7 +50,6 @@ wepy.app({ ...@@ -55,7 +50,6 @@ wepy.app({
{ {
pages: [ pages: [
'pages/index', 'pages/index',
'pages/auth'
], ],
window: { window: {
navigationStyle: "custom", navigationStyle: "custom",
......
<style lang="less">
.contain {
padding:200rpx 0;
}
</style>
<template>
<div class="contain">
<p>需要进行微信授权</p>
<button open-type="getUserInfo" bindgetuserinfo="getUserInfo">授权登录</button>
</div>
</template>
<script>
import wepy from '@wepy/core';
import store from '../store';
wepy.page({
hooks: {
'before-setData': function (dirty) {
}
},
data: {
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
computed: {
},
methods: {
getUserInfo (e) {
store.dispatch('setUserInfo',e.$wx.detail.userInfo);
wx.reLaunch({
url: '/pages/index',
})
}
},
created () {
}
});
</script>
<config>
{
navigationBarTitleText: '微信授权',
usingComponents: {
'van-button': '../components/vant/button/index',
}
}
</config>
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