# 调试接口
直接访问域名,您会打开站点的web
端页面;前后端代码分离,但默认情况下前后端的部署是不分离的,您需要使用特别的方式来直接访问接口。
# 方案一:URL
加参
# 假设要调试的接口为
http://localhost:8000/admin/index/index
# 加参后为
http://localhost:8000/admin/index/index?server=1
# 方案二:请求加header
需要加的header
同样为server=1
,这也是BuildAdmin
自身的web
端请求接口的方式。
# 方案三:URL
加index.php
# 假设要调试的接口为
http://localhost:8000/admin/index/index
# 加 index.php 后为
http://localhost:8000/index.php/admin/index/index