PHP之如何编写一个Vue的API后台(一)

首先我们先建立文件的结构

如下图:

 

 components - 存放所有的全局方法,比如:autoplay的函数

 lib - 所有第三方的方法  比如:DBTool:数据库的方法

 logs -  日志

 webroot - 整个api的入口文件,就是xxx.com访问的文件夹

 config.php - 全局的设置

 constant.php - 所有参数的设定,如

class SMS_USEFOR extends CONST_CLASS
{
  const REGISTER = 1;//注册用验证码
  const LOGIN = 2;//登陆用验证码
  const RESTPWD = 3;//找回密码用验证码
  const RESTTEL = 4;//修改手机号用验证码
}

 

 

 

未完待续...

posted @ 2019-09-02 16:37  JeckyHuang  阅读(624)  评论(0编辑  收藏  举报