微信小程序发送请求问题

微信小程序中 往接口发送信息时提示 TypeError: Cannot read property 'server' of undefined

但是console.log 打出来的地址是正确的

这是哪里的问题

console.log(getApp().globalData.server)
      wx.request({
        url: getApp().globalDate.server, 
        data: {
          "params": {
            "ac": that.data.phonenum,
            "se": that.data.password,
            "role": "family"
          }
        },
        header: {
          'content-type': 'application/json' // 默认值
        },
        success(res) {
          console.log(res.data)
        }
      })

这个报错,基本可以断定是你的URL出现了问题,getApp().globalDate大概率为空。
还是检查一下赋值的代码吧。(比如有异步操作赋值什么的)

console.log(getApp().globalData.server) 这个能打印是吧 ,那就奇怪了

非常离谱
console里写的是 console.log(getApp().globalData.server)
url 写的是 url: getApp().globalDate.server,
globalDate 和 globalData 傻傻分不清楚吗?