首页 > 如何在调用discuz接口中传递登录状态

如何在调用discuz接口中传递登录状态

例如我需要请求一个需要积分帖子的详情

curl http://mingyinet.ihaoyisheng.com/bbs/api/mobile/index.php?submodule=checkpost&version=1&mobile=no&module=viewthread&ppp=10&tid=33&page=1

返回的数据为:

{
    ...
    "Message": {
        "messageval": "thread_nopermission//1",
        "messagestr": "抱歉,本帖要求阅读权限高于 200 才能浏览"
    }
}

如何在调用discuz接口中传递登录状态?是否有可用的登录接口?


有登陆接口的,基于你的url就是

http://mingyinet.ihaoyisheng.com/bbs/api/mobile/index.php?module=login

和浏览器登陆的参数保持一致,大概是这样

http://mingyinet.ihaoyisheng.com/bbs/api/mobile/index.php?module=login&mod=logging&action=login&username=&password=

具体可以看看这个文件里的参数验证

bbs\source\class\class_member.php

的on_login方法

【热门文章】
【热门文章】