This article is a mirror article of machine translation, please click here to jump to the original article.

View: 75305|Reply: 19

[Fine Source Code] Discuz API&JSON is available for IOS and Android mobile development

[Copy link]
Posted on 5/22/2018 3:39:22 PM | | |
Discuz API Construction

Download the API file:

Tourists, if you want to see the hidden content of this post, pleaseReply


Put the appapi folder in the DZ directory to execute ithttp://xxxx.com/appapi/install.php

When the browser says "Installed Successful", you can perform the following operations

Directory structure

<appapi>
├connect.php
├image.php
├inc.php
├index.php//Home Controller index.php?mod=index&XXX
├install.php//installation file, it is recommended to delete it after the installation is complete.
├login.php // Log in to get the token, which also includes the user's information after logging in.
├register.php
├<config>
│  ├config.php
│  ├config_extra.php
│  ├permission_config.php
│  └smiley_map.php
├<lib>
│  ├class_member.php
│  ├json.class.php
│  ├lib_app_helper_attach.php
│  ├lib_appversion.php
│  ├lib_bfd_app.php
│  ├lib_bfd_perm.php
│  └lib_bfd_user.php
├<qqconnect>
│  ├connect.class.php
│  ├index.htm
│  ├qqshow.inc.php
│  ├spacecp.inc.php
│  ├<connect>
│  │  ├connect_check.php
│  │  ├connect_config.php
│  │  ├connect_feed.php
│  │  ├connect_login.php
│  │  ├connect_user.php
│  │  └index.htm
│  ├<table>
│  │  ├index.htm
│  │  ├table_common_connect_guest.php
│  │  ├table_common_member_connect.php
│  │  ├table_connect_disktask.php
│  │  ├table_connect_feedlog.php
│  │  ├table_connect_memberbindlog.php
│  │  ├table_connect_postfeedlog.php
│  │  └table_connect_tthreadlog.php
│  ├<template>
│  │  ├extend_common.css
│  │  ├extend_module.css
│  │  ├index.htm
│  │  ├module.htm
│  │  ├qqshow.htm
│  │  └spacecp.htm
├<source>
│  ├bfd_app_favorite_action.php
│  ├bfd_app_favorite_list.php
│  ├bfd_app_forum_list.php
│  ├bfd_app_forum_misc.php
│  ├bfd_app_group_action.php
│  ├bfd_app_group_all.php
│  ├bfd_app_group_index.php
│  ├bfd_app_group_info.php
│  ├bfd_app_group_my.php
│  ├bfd_app_group_thread.php
│  ├bfd_app_group_thread2.php
│  ├bfd_app_index.php
│  ├bfd_app_index_threads.php
│  ├bfd_app_index2.php
│  ├bfd_app_post_newthread.php
│  ├bfd_app_post_reply.php
│  ├bfd_app_search.php
│  ├bfd_app_send_pm.php
│  ├bfd_app_sign.php
│  ├bfd_app_space_notice.php
│  ├bfd_app_space_pm.php
│  ├bfd_app_space_thread.php
│  ├bfd_app_thread_activity.php
│  ├bfd_app_tip.php
│  ├bfd_app_tip_message.php
│  ├bfd_app_topicadmin.php
│  ├bfd_app_user_action.php
│  ├bfd_app_user_avatar.php
│  ├bfd_app_user_detail.php
│  ├bfd_app_user_follow.php
│  ├bfd_app_user_friend.php
│  ├bfd_app_user_space.php
│  ├bfd_app_userinfo.php
│  ├<include>
│  │  ├thread_activity.php
│  │  ├thread_activity_form.htm
│  │  ├thread_poll.php
│  │  └viewthread_activity.htm
│  ├<search>
│  │  ├index.htm
│  │  ├search_album.php
│  │  ├search_blog.php
│  │  ├search_collection.php
│  │  ├search_forum.php
│  │  ├search_group.php
│  │  ├search_my.php
│  │  ├search_portal.php
│  │  └search_user.php
│  ├<topicadmin>
│  │  ├topicadmin_delpost.php
│  │  └topicadmin_moderate.php
├<template>
│  ├footer.htm
│  ├header.htm
│  ├register.htm
│  ├seccheck.htm
│  ├<style>
│  │  ├common.js
│  │  ├jquery-1.8.3.min.js
│  │  ├style.css
│  │  ├<images>
│  │  │  ├login.png
│  │  │  └login_on.png
├<unit_test>
│  ├test.php
│  ├test_config.php
│  ├test_function.php
│  ├test_inc.php
│  └test_send_pm.php

Log in to Token to get it

We want to get the user's details and post a token to store a Cookis Login.php user login
Open Login and we can see it.

We only need to pass in the values of these two variables in POST to log in.

JSON returns value

Returns the user's basic avatar, username, email address, and other information, which can be modified in the source file.

{"errornum":"E00000","errormsg":"\u7528\u6237\u767b\u5f55\u6210\u529f","data":{"uid":"1","avatar":"http:\/\/127.0.0.1\/dz\/uc_server\/avatar.php?uid=1&size=middle"," username":"admin","email":"admin@admin.com","password":"a5ecf2332da38601e6fadd79ee69840f","groupid":"1","extcredits1":"0","extcredits2":"2","follower":"0","following" :"0","gender":"\u4fdd\u5bc6","department":"","constellation":"","medals":[],"bloodtype":"","sightml":"","token": "65faMdFDBMcsPpO3zghoLJIAsBLOFRNbOU61rjVZsCYtN8zAlOoW4hbRUno4fufoxtbtwuJX1L+iur97LFjWVnkBow17h\/vAnGk","token_expire":"1493655981"}}
The main thing we need is to get the user's unique token.
"token":"65faMdFDBMcsPpO3zghoLJIAsBLOFRNbOU61rjVZsCYtN8zAlOoW4hbRUno4fufoxtbtwuJX1L+iur97LFjWVnkBow17h\/vAnGk"
Then we write it into Cookis, and we can do other operations in the index.php?mod. We are just roughly talking about the usage here, the specific usage of some API documents, the controller corresponding to the LIB has been explained, and there are places where I don't understand, please leave me a message.





Previous:You are using safe update mode and you tried to update a t
Next:Browser requests appear Provisional headers are showing solution
Posted on 2/19/2020 3:56:02 PM |
Thank you for sharing, working together, and encouraging each other
Posted on 6/1/2020 3:21:52 PM |
Thank you for sharing, working together, and encouraging each other
Posted on 7/25/2019 4:00:01 PM |
Hopefully, this document does not have a national flag
Posted on 7/8/2019 1:24:35 PM |
To put it bluntly, the landlord has worked hard
Posted on 7/25/2019 9:10:18 AM |
See how
Posted on 7/29/2019 4:11:46 AM |
Good things thank you for sharing
Posted on 12/17/2019 11:38:28 AM |
To put it bluntly, the landlord has worked hard
Posted on 2/1/2020 11:50:10 AM |
Learn to learn...
Posted on 2/1/2020 11:53:00 AM |
Learn to learn...
Posted on 2/26/2020 7:16:55 AM |
I want to see this one, haha!!
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com