1.设置合法域名

2.微信登录用户信息获取
如果要求登录后,无法显示用户信息
 
 
则应该修改一下【调试基础库】

3.获取用户登录的openid
index/index.wxml
  <view>
    <button type="warn" bindtap="wxLogin">微信登录</button>
    授权码:{{code}}
  </view>index/index.js
Page({
      //微信登录,获取微信用户的授权码:openId【每一次都不一样】
  wxLogin(){
    wx.login({
      success:(res)=>{
        console.log(res.code);
        this.setData({
          code:res.code
        })
      }
    })
  },
})4.向后端发送请求
index/index.wxml
  <view>
    <button bindtap="sendRequest" type="default">发送请求</button>
  </view>index/index.js
  //发送请求
  sendRequest(){
    wx.request({
      url: 'http://localhost:8080/user/shop/status',
      method:'GET',
      success:(res)=>{
        //res返回的是整个JSON对象
        console.log(res.data);
      }
    })
  }
















