Advertisement

微信小程序前后台交互(后台使用SSM框架)

阅读量:

微信小程序前端代码 :

index.js文件中page对象的onload函数。

复制代码
 onLoad: function () {

    
     wx.request({
    
       url: 'http://localhost:8080/BaseProjectSSM/admin/clazz_table/list2',
    
       method: 'post',
    
       header: {
    
     'content-type': 'application/json' // 默认值
    
       },
    
       success: res => {
    
     console.log(res.data)
    
     this.setData({
    
       
    
     })
    
       },
    
       fail: res => {
    
     console.log("失败")
    
       }
    
     })
    
     if (app.globalData.userInfo) {
    
       this.setData({
    
     userInfo: app.glo

全部评论 (0)

还没有任何评论哟~