- 设置允许查询的模块
- 设置接口秘钥
- 设置是IP白名单
- 设置是否开启检查IP访问权限
- 前台ajax请求数据方法:
<script>
$.ajax({
url:"{fun U('GetData/index')}",
dataType:"json",
async:true,
data:{model:'article',key:'123456',tid:1,isshow:1,orders:'addtime desc',limit:1,fields:'id,title,litpic,body'},
type:"POST",
beforeSend:function(){
},
success:function(r){
console.log(r);
},
complete:function(){
},
error:function(){
}
})
</script>
- 可以进行提交更新操作(需要先在插件里面开启了才可以):
<script>
$.ajax({
url:"{fun U('GetData/savedata')}",
dataType:"json",
async:true,
data:{model:'article',key:'123456',tid:1,title:'测试文章新增',body:'测试内容abc'},
type:"POST",
beforeSend:function(){
},
success:function(r){
console.log(r);
},
complete:function(){
},
error:function(){
}
})
</script>
- 根据页码获取对应列表数据,自带获取子栏目数据
<script>
$.ajax({
url:"{fun U('GetData/getDataPage')}",
dataType:"json",
async:true,
data:{model:'article',key:'123456',tid:1,limit:10,page:2},
type:"POST",
beforeSend:function(){
},
success:function(r){
console.log(r);
},
complete:function(){
},
error:function(){
}
})
</script>
- 获取搜索内容信息,可根据页码获取列表数据,自带获取子栏目数据
<script>
$.ajax({
url:"{fun U('GetData/getDataSearch')}",
dataType:"json",
async:true,
data:{model:'article',key:'123456',tid:1,limit:10,page:2,search:'title,keywords,body',word:'极致CMS'},
type:"POST",
beforeSend:function(){
},
success:function(r){
console.log(r);
},
complete:function(){
},
error:function(){
}
})
</script>