## 导入代码 导入代码到小程序开发工具里 ## 安装服务器 api 代码 到https://github.com/thinkcmf/thinkcmfapi 下载代码 1. 请先安装ThinkCMF5 https://github.com/thinkcmf/thinkcmf 2. 再把api代码覆盖到 thinkcmf5根目录(最终目录参考http://www.kancloud.cn/thinkcmf/doc/266477) ``` thinkcmf 根目录 ├─api api目录 ├─app 应用目录 │ ├─portal 门户应用目录 │ │ ├─config.php 应用配置文件 │ │ ├─common.php 模块函数文件 │ │ ├─controller 控制器目录 │ │ ├─model 模型目录 │ │ └─ ... 更多类库目录 │ ├─ ... 更多应用 │ ├─command.php 命令行工具配置文件 │ ├─common.php 应用公共(函数)文件 │ ├─config.php 应用(公共)配置文件 │ ├─database.php 数据库配置文件 │ ├─tags.php 应用行为扩展定义文件 │ └─route.php 路由配置文件 ├─data 数据目录 │ ├─conf 动态配置目录 │ ├─runtime 应用的运行时目录(可写) │ └─ ... 更多 ├─public WEB 部署目录(对外访问目录) │ ├─api api入口目录 │ ├─plugins 插件目录 │ ├─static 静态资源存放目录(css,js,image) │ ├─themes 前后台主题目录 │ │ ├─admin_simpleboot3 后台默认主题 │ │ └─simpleboot3 前台默认主题 │ ├─upload 文件上传目录 │ ├─index.php 入口文件 │ ├─robots.txt 爬虫协议文件 │ ├─router.php 快速测试文件 │ └─.htaccess apache重写文件 ├─simplewind │ ├─cmf CMF核心库目录 │ ├─extend 扩展类库目录 │ ├─thinkphp thinkphp目录 │ └─vendor 第三方类库目录(Composer) ├─composer.json composer 定义文件 ├─LICENSE.txt 授权说明文件 ├─README.md README 文件 ├─think 命令行入口文件 ``` ## 更改api 地址 在`utils/api.js`下有 host 变量,更为你的服务器地址 > 微信上预览或体验时,host最好是真实服务器地址,并且正确配置 https,否则没有数据 ## 下载小程序管理插件(5.0.180123已经内置此插件) https://www.thinkcmf.com/appstore/plugin/129.html 在插件里配置好自己主要小程序的 appid 和 appsecret