1.GET拼接获取参数错误:http://127.0.0.1:8088/tp5/public/new/year/2018/month/4
解决:http://serverName/index.php(或者其它应用入口文件)/模块/控制器/操作/[参数名/参数值...]
操作名不能使用index.应使用实际操作名
2.Route的使用
route.php中添加以下代码
use think\Route;
Route::get('new','api/User/getDate'); /get方法,‘new’代替 api/User/getDate
网友评论