前后端分离
后台小网站
- 前端使用 vue+vue-router+element-ui+npm+webpack
- 后台接口使用 php
git clone https://github.com/HJaycee/SimpleAdmin.git cd SimpleAdmin npm install
npm run dev
cd SimpleAdmin npm run build // 编译完成后,将 dist 目录下的文件上传到服务器目录下
// 因为使用 vue-router 的 hitory 模式,服务器需要做相关配置自动重定向到 index.html // apache 下创建隐藏文件.htaccess,填以下内容 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] </IfModule>
已实现功能
- 登录 /注册
- 留言
- 留言列表
- 身份过期处理
相关配置
/config/index.js // 反向代理 /src/router/index.js // 路由 /url/api.js // 请求接口
- 环境要求 php5
- 使用 ThinkPHP3.2.3
- 提供前端需要的相关接口:登录接口返回 token,其它接口效验 token 是否过期
user // 用户表 feedback // 留言表
1 alber1986 2017-11-29 10:29:36 +08:00 ![]() 这个还不错 |