xt-laravel-admin/readme.md
2018-12-16 12:37:13 +08:00

161 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

f-admin基础权限后台
===============
❤️ 本项目 [GitHub](https://github.com/fangzesheng/f-admin) / [Gitee(码云)](https://gitee.com/fzsfzs/f-admin),目前已在公司产品应用,运行在数个客户服务器内。
f-admin基础权限后台是一套基于Laravel框架开发的系统不需要开发者重复不必要的工作就可以实现后台功能的快速开发其主要特点包括
- [x] 集成 Composer安装使用方便。
- [x] 用户管理可以配置自己的权限。
- [x] 角色管理可以配置用户及权限。
- [x] 权限控制可以精确到某一个请求的控制。
- [x] 菜单可以设置自己的图标,可以控制哪些角色可以看到。
- [x] 日志查看搜索。
- [x] 严格的前端后端输入验证。
- [x] pc端和手机端都能适配。
- [ ] 其它优化,持续进行中 ......
> f-admin的运行环境要求PHP5.4以上laravel框架要求为5.4。
线上DEMO [f-admin](http://f-admin.fang99.cc)
## 导航
* [效果预览(pc/mobile)](#效果预览(pc/mobile))
- [首页](#首页)
- [用户管理](#用户管理)
- [角色管理](#角色管理)
- [权限管理](#权限管理)
- [菜单管理](#菜单管理)
- [日志管理](#日志管理)
* [安装步骤](#安装步骤)
- [1.获取代码](#1.获取代码)
- [2.安装依赖](#2.安装依赖)
- [3.生成APP_KEY](#3.生成APP_KEY)
- [4.修改`env`配置](#4.修改-env-配置)
- [5.数据库迁移](#5.数据库迁移)
- [6.访问首页](#6.访问首页)
* [环境配置(仅供参考)](#环境配置(仅供参考))
- [1.windows](#1.windows)
- [2.linux(apache)](#2.linux(apache))
- [3.linux(nginx)](#3.linux(nginx))
* [感谢](#感谢)
## 效果预览(pc/mobile)
#### 首页
![](./img/index.png)
![](./img/m-index.png)
#### 用户管理
![](./img/user.png)
![](./img/m-user.png)
#### 角色管理
![](./img/role.png)
![](./img/m-role.png)
#### 权限管理
![](./img/pre.png)
![](./img/m-pre.png)
#### 菜单管理
![](./img/menu.png)
![](./img/m-menu.png)
#### 日志管理
![](./img/log.png)
![](./img/m-log.png)
## 安装步骤
#### 1.获取代码
新建一个文件夹进入该文件夹利用git等工具输入以下命令
git init
git clone https://github.com/fangzesheng/f-admin.git
#### 2.安装依赖
composer install
#### 3.生成APP_KEY
cp .env.example .env
php artisan key:generate
#### 4.修改 `.env` 配置
DB_CONNECTION=mysql
DB_HOST=your_host
DB_PORT=your_port
DB_DATABASE=your_db
DB_USERNAME=your_username
DB_PASSWORD=your_pwd
CACHE_DRIVER=array //将file改为array
#### 5.数据库迁移
php artisan migrate
composer dump-autoload
php artisan db:seed
> 如果在执行php artisan migrate增加表操作出现字段长度过长错误则可能是因为mysql版本低于5.5.3,解决方法:
- a.升级mysql
- b.手动配置迁移命令migrate生成的默认字符串长度在app\Providers\AppServiceProvider中调用一下方法来实现配置
>记得先将新建数据库里面的表清空!!!
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
#### 6.访问首页
访问自己的配置好的域名
用户名admin
密码f123456
## 环境配置(仅供参考)
#### 1.windows
<VirtualHost *:80>
DocumentRoot E:\test\public
ServerName www.test.com
<Directory "E:\test\public">
AllowOverride All
order deny,allow
Require all granted
</Directory>
</VirtualHost>
#### 2.linux(apache)
<VirtualHost *:80>
DocumentRoot /data/wwwroot/default/f-admin/public
ServerName www.fang99.cc
<Directory "/data/wwwroot/default/f-admin/public">
AllowOverride All
order deny,allow
Require all granted
</Directory>
</VirtualHost>
#### 3.linux(nginx)
server {
listen 8088;
server_name demo.fang99.cc;
location / {
index index.php index.html;
root /var/www/f-admin/public/;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
root /var/www/f-admin/public/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
include /etc/nginx/fastcgi.conf;
}
location ~* \.(css|js|jpg|woff|woff2|png)$ {
root /var/www/urpm/resources/assets/;
break;
}
}
## 感谢
- [layer](http://layer.layui.com/)
- [laravel](https://laravel.com/)
如果你觉得这个开源项目对你有用,你懂的!谢谢:)