|
|
@@ -16,6 +16,25 @@ export default {
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
getPhoneNumber(e) {
|
|
|
+ let that = this;
|
|
|
+ uni.checkSession({
|
|
|
+ success () {
|
|
|
+ //session_key 未过期,并且在本生命周期一直有效
|
|
|
+ that.putInfo(e)
|
|
|
+ },
|
|
|
+ fail () {
|
|
|
+ // session_key 已经失效,需要重新执行登录流程
|
|
|
+ uni.login({
|
|
|
+ provider: 'weixin',
|
|
|
+ success: function(loginRes) {
|
|
|
+ that.code = loginRes.code;
|
|
|
+ that.putInfo(e)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ putInfo(e){
|
|
|
let that = this;
|
|
|
if (e.detail.encryptedData) {
|
|
|
//用户同意授权
|