項目地址 Beephp
Bee 是人力資源系統中的考勤應用,主要功能用於員工申請假單。Bee具備較高的性能、擴展性等,其中包括先後端分離、插拔式的規則驗證(驗證器)、數據過濾(裝飾器)、消息隊列等,後端在Laravel 的MVC模式上,又添加了Services、Repositories層,明確每一個類的職責,使用Passport 的密碼模式獲取接口數據。css
其餘的就是一些基本工具了,好比node、npm(cnpm)、composer、git等html
git clone git@github.com:SexyPhoenix/Bee.git
composer install chmod -R 777 storage php artisan key:generate
mkdir -p uploads/bee chmod -R 777 uploads
cp .env.example .env
APP_URL=http://localhost ASSET_URL=http://localhost DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379
php artisan migrate
php artisan passport:keys php artisan passport:client --password --name='bee' //name 自定義
php artisan queue:work bee --queue=apply --sleep=3 --tries=3 & > /dev/null
server { listen 80; server_name dev.bee.goods; // 自定義 index index.html index.htm index.php; location / { rewrite ^/(.*)$ /index.php/$1 last; try_files $uri $uri/ /index.php?$query_string; } location ~ /uploads/ { root "/var/www/Bee"; // 自定義 } location ~ \.(html|gif|jpg|jpeg|css|js|eot|svg|ttf|woff|woff2|png)$ { root "/var/www/Bee/public"; // 自定義 } location ~ (.+\.php)(.*)$ { root /var/www/Bee/public; // 自定義 fastcgi_split_path_info ^(.+\.php)(.+)$; fastcgi_pass unix:/var/run/php-fpm/php7-fpm.sock; // 自定義 fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; fastcgi_buffers 4 16k; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; } }
cnpm install //cnpm淘寶的 export const API_DOMAIN = 'http://xxx/beeapi' //resources\js\config\bee.js 文件中修改域名 npm run dev
最後,注意配置域名到host。前端
打開 http://xxx/bee#/
帳號:zhangxiaofan@qq.com 密碼:123456node