Number3微信小程序获取springboot数据(仅记录)
GET请求呦
这个就是需要制作模拟器,将需要的数据两方联调
首先准备工作

1、微信端 js
wx.request({
url: 'http://localhost:8080/text/auth/getAllData',
data: {
"startTime": this.data.dateStart,
"endTime": this.data.dateEnd
},
success: (res) => {
console.log(res);
this.setData({
htruck: res.data.htruck
});
},
fail: (res) => {
console.log(res.errMsg)
}
})
2、springboot端
package com.example.hello.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import

本文记录了微信小程序通过GET请求与SpringBoot后台进行数据交互的过程,包括微信小程序的JS编写和SpringBoot端的设置,以实现双方联调。
最低0.47元/天 解锁文章
1万+





