├── .gitignore
├── LICENSE
├── README.md
├── app
├── backend
│ ├── .env.example
│ ├── .gitattributes
│ ├── .gitignore
│ ├── _ide_helper.php
│ ├── _ide_helper_models.php
│ ├── app
│ │ ├── Api
│ │ │ └── V1
│ │ │ │ └── Controllers
│ │ │ │ ├── BaseController.php
│ │ │ │ ├── JobController.php
│ │ │ │ ├── PostsController.php
│ │ │ │ ├── ProjectController.php
│ │ │ │ ├── TaskController.php
│ │ │ │ ├── TaskGroupController.php
│ │ │ │ ├── TaskListController.php
│ │ │ │ ├── TaskStageController.php
│ │ │ │ └── UserController.php
│ │ ├── Console
│ │ │ └── Kernel.php
│ │ ├── Constants
│ │ │ └── RestfulCodes.php
│ │ ├── Exceptions
│ │ │ └── Handler.php
│ │ ├── Http
│ │ │ ├── Controllers
│ │ │ │ ├── Auth
│ │ │ │ │ └── AuthController.php
│ │ │ │ └── Controller.php
│ │ │ ├── Kernel.php
│ │ │ └── Middleware
│ │ │ │ ├── AccessControlAllowOrigin.php
│ │ │ │ ├── EncryptCookies.php
│ │ │ │ ├── RedirectIfAuthenticated.php
│ │ │ │ ├── TrimStrings.php
│ │ │ │ ├── TrustProxies.php
│ │ │ │ └── VerifyCsrfToken.php
│ │ ├── Models
│ │ │ ├── Admin.php
│ │ │ ├── Posts.php
│ │ │ ├── Project.php
│ │ │ ├── ProjectPlugin.php
│ │ │ ├── SmartStage.php
│ │ │ ├── SmartTask.php
│ │ │ ├── Tags.php
│ │ │ ├── Task.php
│ │ │ ├── TaskFields.php
│ │ │ ├── TaskGroup.php
│ │ │ ├── TaskList.php
│ │ │ ├── TaskStage.php
│ │ │ ├── TaskType.php
│ │ │ └── User.php
│ │ ├── Providers
│ │ │ ├── AppServiceProvider.php
│ │ │ ├── AuthServiceProvider.php
│ │ │ ├── BroadcastServiceProvider.php
│ │ │ ├── EventServiceProvider.php
│ │ │ ├── MyUserProvider.php
│ │ │ └── RouteServiceProvider.php
│ │ ├── Repositories
│ │ │ ├── ProjectRepository.php
│ │ │ ├── Repository.php
│ │ │ ├── TaskRepository.php
│ │ │ └── UserRepository.php
│ │ └── Services
│ │ │ └── UserService.php
│ ├── artisan
│ ├── bootstrap
│ │ ├── app.php
│ │ └── cache
│ │ │ └── .gitignore
│ ├── composer.json
│ ├── composer.lock
│ ├── config
│ │ ├── api.php
│ │ ├── app.php
│ │ ├── auth.php
│ │ ├── broadcasting.php
│ │ ├── cache.php
│ │ ├── database.php
│ │ ├── filesystems.php
│ │ ├── hashing.php
│ │ ├── jwt.php
│ │ ├── logging.php
│ │ ├── mail.php
│ │ ├── queue.php
│ │ ├── services.php
│ │ ├── session.php
│ │ └── view.php
│ ├── database
│ │ ├── .gitignore
│ │ ├── factories
│ │ │ └── UserFactory.php
│ │ ├── migrations
│ │ │ └── 2018_03_07_140145_create_users_collection.php
│ │ └── seeds
│ │ │ ├── DatabaseSeeder.php
│ │ │ ├── ProjectAppsSeeder.php
│ │ │ ├── ProjectSeeder.php
│ │ │ ├── SmartStageSeeder.php
│ │ │ ├── StageSeeder.php
│ │ │ ├── TaskListSeeder.php
│ │ │ ├── TaskSeeder.php
│ │ │ └── UsersSeeder.php
│ ├── package.json
│ ├── phpunit.xml
│ ├── public
│ │ ├── .htaccess
│ │ ├── css
│ │ │ └── app.css
│ │ ├── favicon.ico
│ │ ├── index.php
│ │ ├── js
│ │ │ └── app.js
│ │ └── robots.txt
│ ├── resources
│ │ ├── assets
│ │ │ ├── js
│ │ │ │ ├── app.js
│ │ │ │ ├── bootstrap.js
│ │ │ │ └── components
│ │ │ │ │ └── ExampleComponent.vue
│ │ │ └── sass
│ │ │ │ ├── _variables.scss
│ │ │ │ └── app.scss
│ │ ├── lang
│ │ │ └── en
│ │ │ │ ├── auth.php
│ │ │ │ ├── pagination.php
│ │ │ │ ├── passwords.php
│ │ │ │ └── validation.php
│ │ └── views
│ │ │ ├── auth
│ │ │ ├── login.blade.php
│ │ │ ├── passwords
│ │ │ │ ├── email.blade.php
│ │ │ │ └── reset.blade.php
│ │ │ └── register.blade.php
│ │ │ ├── home.blade.php
│ │ │ ├── layouts
│ │ │ └── app.blade.php
│ │ │ └── welcome.blade.php
│ ├── routes
│ │ ├── api.php
│ │ ├── channels.php
│ │ ├── console.php
│ │ └── web.php
│ ├── server.php
│ ├── storage
│ │ ├── app
│ │ │ ├── .gitignore
│ │ │ └── public
│ │ │ │ └── .gitignore
│ │ ├── framework
│ │ │ ├── .gitignore
│ │ │ ├── cache
│ │ │ │ └── .gitignore
│ │ │ ├── sessions
│ │ │ │ └── .gitignore
│ │ │ ├── testing
│ │ │ │ └── .gitignore
│ │ │ └── views
│ │ │ │ └── .gitignore
│ │ └── logs
│ │ │ └── .gitignore
│ ├── tests
│ │ ├── CreatesApplication.php
│ │ ├── Feature
│ │ │ └── ExampleTest.php
│ │ ├── TestCase.php
│ │ └── Unit
│ │ │ └── ExampleTest.php
│ ├── webpack.mix.js
│ └── yarn.lock
└── tmp
│ ├── ot.php
│ ├── 依赖注入.php
│ └── 服务容器.php
├── data
├── .gitignore
├── backup
│ └── README.txt
├── mongo
│ └── db
│ │ ├── WiredTiger
│ │ ├── WiredTiger.lock
│ │ └── mongod.lock
└── redis
│ └── README.txt
├── docker-compose
├── docker-compose.yml
├── dockerfiles
├── backup
│ ├── Dockerfile
│ ├── backup-default.sh
│ ├── restore-default.sh
│ └── task-start.sh
├── composer
│ ├── Dockerfile
│ └── docker-entrypoint.sh
├── mysql
│ └── conf.d
│ │ └── mysql.conf
├── nginx
│ ├── Dockerfile
│ ├── conf.d
│ │ └── default.conf
│ └── nginx.conf
├── php
│ ├── Dockerfile
│ ├── Dockerfile.production
│ ├── php-dev.ini
│ ├── php-fpm.conf
│ ├── php-pro.ini
│ └── php.ini
└── redis
│ └── Dockerfile
├── docs
└── README.txt
├── logs
├── mysql
│ └── README.txt
├── nginx
│ └── README.txt
├── php-fpm
│ ├── README.txt
│ └── www.log.slow
└── redis
│ └── README.txt
└── screenshots
└── exec.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | /.idea
3 | #数据库文件
4 |
5 | /data/mysql/*
6 | /data/redis/*
7 | /data/backup/*
8 | !/data/backup/README.txt
9 | !/data/mysql/README.txt
10 | /logs/mysql/*.log
11 | /logs/nginx/*.log
12 | /logs/php-fpm/*.log
13 | /logs/redis/*.log
14 |
15 | !/data/backup/*.sql
16 | !/data/redis/README.txt
17 |
18 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
3 | 版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
4 | All rights reserved。
5 | ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
6 |
7 | Apache Licence是著名的非盈利开源组织Apache采用的协议。
8 | 该协议和BSD类似,鼓励代码共享和尊重原作者的著作权,
9 | 允许代码修改,再作为开源或商业软件发布。需要满足
10 | 的条件:
11 | 1. 需要给代码的用户一份Apache Licence ;
12 | 2. 如果你修改了代码,需要在被修改的文件中说明;
13 | 3. 在延伸的代码中(修改和有源代码衍生的代码中)需要
14 | 带有原来代码中的协议,商标,专利声明和其他原来作者规
15 | 定需要包含的说明;
16 | 4. 如果再发布的产品中包含一个Notice文件,则在Notice文
17 | 件中需要带有本协议内容。你可以在Notice中增加自己的
18 | 许可,但不可以表现为对Apache Licence构成更改。
19 | 具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | POSSIBILITY OF SUCH DAMAGE.
33 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Overview
2 | 客户端项目请查看:
3 | https://github.com/zhaojunlike/vue-scrum-task-client
4 |
5 | ### Containers
6 | - 1.nginx
7 | - 2.mysql-db
8 | - 3.redis-db
9 | - 4.php-fpm
10 | - 5.composer
11 | - 6.mongo-db
12 | - 7.visualizer
13 |
14 | 其中不需要的镜像可以注释掉
15 |
16 | ## QuickStart
17 |
18 |
19 |
20 | ### Install Docker
21 | 安装Docker Ce
22 | ```bash
23 | $bash ./app/tools/docker-installer.sh
24 | ```
25 | ### Install docker-compose
26 | ```bash
27 | $cp ./docker-compose /usr/local/bin/
28 | $chmod +x /usr/lcoal/bin/docker-compose
29 | ```
30 | ## Usage
31 |
32 | 默认启动方式,这种方式适用于本地测试开发环境,暴漏了数据库端口redis端口方便调试
33 | 1.docker-compose up --build
34 |
35 | ```bash
36 | docker-compose up -d
37 | docker exec -it $phpContainerId bash
38 | #bash > cd /app/backend
39 | #bash > composer install
40 | #bash > php artisan db:seed
41 | ```
42 | 
43 |
44 |
45 | ## Future
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/backend/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 |
9 | DB_CONNECTION=mysql
10 | DB_HOST=127.0.0.1
11 | DB_PORT=3306
12 | DB_DATABASE=homestead
13 | DB_USERNAME=homestead
14 | DB_PASSWORD=secret
15 |
16 | BROADCAST_DRIVER=log
17 | CACHE_DRIVER=file
18 | SESSION_DRIVER=file
19 | SESSION_LIFETIME=120
20 | QUEUE_DRIVER=sync
21 |
22 | REDIS_HOST=127.0.0.1
23 | REDIS_PASSWORD=null
24 | REDIS_PORT=6379
25 |
26 | MAIL_DRIVER=smtp
27 | MAIL_HOST=smtp.mailtrap.io
28 | MAIL_PORT=2525
29 | MAIL_USERNAME=null
30 | MAIL_PASSWORD=null
31 | MAIL_ENCRYPTION=null
32 |
33 | PUSHER_APP_ID=
34 | PUSHER_APP_KEY=
35 | PUSHER_APP_SECRET=
36 | PUSHER_APP_CLUSTER=mt1
37 |
38 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
39 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
40 |
--------------------------------------------------------------------------------
/app/backend/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/app/backend/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /storage/*.key
5 | /vendor
6 | /.idea
7 | /.vscode
8 | /.vagrant
9 | Homestead.json
10 | Homestead.yaml
11 | npm-debug.log
12 | yarn-error.log
13 | .env
14 |
--------------------------------------------------------------------------------
/app/backend/_ide_helper_models.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 |
11 | namespace App\Models{
12 | /**
13 | * App\Models\Admin
14 | *
15 | * @property-read mixed $id
16 | */
17 | class Admin extends \Eloquent {}
18 | }
19 |
20 | namespace App\Models{
21 | /**
22 | * App\Models\Project
23 | *
24 | * @property-read mixed $id
25 | */
26 | class Project extends \Eloquent {}
27 | }
28 |
29 | namespace App\Models{
30 | /**
31 | * App\Models\User
32 | *
33 | * @property-read mixed $id
34 | * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications
35 | */
36 | class User extends \Eloquent {}
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/app/backend/app/Api/V1/Controllers/BaseController.php:
--------------------------------------------------------------------------------
1 | cUser = auth()->user();
39 | }
40 |
41 |
42 | public function buildApiSuccess()
43 | {
44 |
45 |
46 | }
47 |
48 | public function buildFailSuccess($msg, $code = 500, $data = null)
49 | {
50 |
51 | }
52 | }
--------------------------------------------------------------------------------
/app/backend/app/Api/V1/Controllers/JobController.php:
--------------------------------------------------------------------------------
1 | projectRepos = $repository;
27 | }
28 |
29 | public function index()
30 | {
31 | $id = request('id', null);
32 | if ($id === null) {
33 | $myProjects = $this->projectRepos
34 | ->myProjects()->get();
35 | return $this->response->array([
36 | 'projects' => $myProjects
37 | ]);
38 | } else {
39 | $where = ['_id' => $id];
40 | $project = $this->projectRepos
41 | ->where($where)
42 | ->first();
43 | return $this->response->array([
44 | 'query' => $where,
45 | 'project' => $project
46 | ]);
47 | }
48 | }
49 |
50 | public function store()
51 | {
52 |
53 | $project = $this->projectRepos->createProject();
54 | return $this->response->array([
55 | 'message' => '添加成功',
56 | 'project' => $project
57 | ]);
58 | }
59 |
60 |
61 | public function update($id)
62 | {
63 | $project = Project::where(['_id' => $id])->first();
64 | $project->title = request('title');
65 | $project->description = request('description');
66 | $project->save();
67 |
68 | return $project;
69 | }
70 |
71 | public function destroy($id)
72 | {
73 |
74 | }
75 |
76 | public function posts($projectId)
77 | {
78 | $posts = Posts::where('_project_id', $projectId)
79 | ->where('_creator_id', $this->cUser['_id'])
80 | ->get();
81 | return $posts;
82 | }
83 | }
--------------------------------------------------------------------------------
/app/backend/app/Api/V1/Controllers/TaskController.php:
--------------------------------------------------------------------------------
1 | taskRepos = $taskRepository;
25 | }
26 |
27 |
28 | public function index()
29 | {
30 | $projectId = request('project_id');
31 | $stageId = request('stage_id');
32 | $tasks = $this->taskRepos
33 | ->myTasks($this->cUser)
34 | ->where([
35 | '_project_id' => $projectId,
36 | '_stage_id' => $stageId
37 | ])
38 | ->orderBy('status', 'asc')
39 | ->get();
40 | return $tasks;
41 |
42 | }
43 |
44 | public function store()
45 | {
46 | $projectId = request('_project_id');
47 | $stageId = request('_stage_id');
48 | $taskListId = request('_task_list_id');
49 |
50 | $task = new Task([
51 | '_creator_id' => $this->cUser['_id'],
52 | '_project_id' => $projectId,
53 | '_stage_id' => $stageId,
54 | '_task_list_id' => $taskListId,
55 | 'title' => request('title'),
56 | 'mark' => request('mark'),
57 | 'note' => request('note'),
58 | 'status' => request('status')
59 | ]);
60 |
61 | $task->save();
62 | return $task;
63 | }
64 |
65 | public function update(Request $request, $id)
66 | {
67 | $task = Task::where('_id', $id)->first();
68 | if (!$task) {
69 | throw new ResourceNotFoundException('Not found Res');
70 | }
71 | $task->status = request('status');
72 | $task->save();
73 | return $task;
74 | }
75 |
76 | public function move($id)
77 | {
78 | $task = Task::where('_id', $id)->first();
79 | $task->_stage_id = request('_stage_id');
80 | $task->save();
81 | return $task;
82 | }
83 | }
--------------------------------------------------------------------------------
/app/backend/app/Api/V1/Controllers/TaskGroupController.php:
--------------------------------------------------------------------------------
1 | get();
22 | return $taskGroups;
23 | }
24 | }
--------------------------------------------------------------------------------
/app/backend/app/Api/V1/Controllers/TaskListController.php:
--------------------------------------------------------------------------------
1 | get();
22 | return $taskLists;
23 | }
24 |
25 | public function update($id)
26 | {
27 | $taskList = TaskList::where('_id', $id)->first();
28 | $stageIds = request('stage_ids');
29 | $taskList->stage_ids = $stageIds;
30 | $taskList->save();
31 | //TODO 优化
32 | foreach ($stageIds as $k => $stageId) {
33 | TaskStage::where('_id', $stageId)->update(['sort' => $k]);
34 | }
35 | return $taskList;
36 | }
37 | }
--------------------------------------------------------------------------------
/app/backend/app/Api/V1/Controllers/TaskStageController.php:
--------------------------------------------------------------------------------
1 | first();
25 | //然后通过
26 | $stageIds = (array)$taskList['stage_ids'];
27 | $taskStages = TaskStage::where('_project_id', $projectId)
28 | ->where('_task_list_id', $taskListId)
29 | ->whereIn('_id', $stageIds)
30 | ->orderBy('sort', 'ASC')
31 | ->get();
32 |
33 | return $taskStages;
34 | }
35 |
36 | /**
37 | * 添加任务阶段
38 | * @return TaskStage
39 | */
40 | public function store()
41 | {
42 | $projectId = request('_project_id');
43 | $taskListId = request('_task_list_id');
44 |
45 | $taskList = TaskList::where('_id', $taskListId)->first();
46 | $taskStage = new TaskStage([
47 | '_project_id' => $projectId,
48 | '_task_list_id' => $taskListId,
49 | '_creator_id' => $this->cUser['_id'],
50 | 'name' => request('name'),
51 | 'is_archived' => false,
52 | 'sort' => count($taskList->stage_ids)
53 | ]);
54 | $taskStage->save();
55 | /*更新任务列表*/
56 | TaskList::where('_id', $taskListId)->push('stage_ids', $taskStage->_id);
57 |
58 | return $taskStage;
59 | }
60 |
61 | public function update($id)
62 | {
63 |
64 | }
65 | }
--------------------------------------------------------------------------------
/app/backend/app/Api/V1/Controllers/UserController.php:
--------------------------------------------------------------------------------
1 | command('inspire')
28 | // ->hourly();
29 | }
30 |
31 | /**
32 | * Register the commands for the application.
33 | *
34 | * @return void
35 | */
36 | protected function commands()
37 | {
38 | $this->load(__DIR__.'/Commands');
39 |
40 | require base_path('routes/console.php');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/backend/app/Constants/RestfulCodes.php:
--------------------------------------------------------------------------------
1 | 1001,
31 | 'FAIL' => 1004,
32 | 'ERROR' => 1002,
33 |
34 | 'OK' => 200,
35 | 'CREATED' => 204,
36 | 'INVALID_REQUEST' => 400,
37 | 'Unauthorized' => 401,
38 | 'NOT_FOUND' => 404
39 | ];
40 | }
--------------------------------------------------------------------------------
/app/backend/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | middleware('auth:api', ['except' => ['login']]);
27 | }
28 |
29 | /**
30 | * Get a JWT via given credentials.
31 | *
32 | * @return \Illuminate\Http\JsonResponse
33 | */
34 | public function login()
35 | {
36 | $user = request(['username', 'password']);
37 | if (!$token = auth()->attempt($user)) {
38 | return response()->json([
39 | 'status_code' => 1004,
40 | 'message' => '授权失败'
41 | ]);
42 | }
43 | return response()->json($this->respondWithToken($token));
44 | }
45 |
46 | /**
47 | * Get the authenticated User.
48 | *
49 | * @return \Illuminate\Http\JsonResponse
50 | */
51 | public function profile()
52 | {
53 | $user = auth()->user();
54 | return response()->json([
55 | 'status_code' => 200,
56 | 'message' => 'success',
57 | 'data' => [
58 | 'user' => $user
59 | ]
60 | ]);
61 | }
62 |
63 | /**
64 | * 注销用户
65 | * @return \Illuminate\Http\JsonResponse
66 | */
67 | public function logout()
68 | {
69 | auth()->logout();
70 | return \Response::json(['message' => 'Logout Success', 'status_code' => 200]);
71 | }
72 |
73 | /**
74 | * Refresh a token.
75 | */
76 | public function refresh()
77 | {
78 | return $this->respondWithToken(auth()->refresh());
79 | }
80 |
81 | /**
82 | * @param $token
83 | * @return array
84 | */
85 | protected function respondWithToken($token)
86 | {
87 | return [
88 | 'status_code' => RestfulCodes::$CODES['SUCCESS'],
89 | 'message' => 'success',
90 | 'data' => [
91 | 'access_token' => $token,
92 | 'expires_in' => auth()->factory()->getTTL() * 60
93 | ]
94 | ];
95 | }
96 | }
--------------------------------------------------------------------------------
/app/backend/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | [
33 | \App\Http\Middleware\EncryptCookies::class,
34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35 | \Illuminate\Session\Middleware\StartSession::class,
36 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
38 | \App\Http\Middleware\VerifyCsrfToken::class,
39 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
40 | ],
41 | 'api' => [
42 | 'throttle:60,1',
43 | 'bindings',
44 | ],
45 | ];
46 |
47 | /**
48 | * The application's route middleware.
49 | * 程序路由中间件
50 | * These middleware may be assigned to groups or used individually.
51 | *
52 | * @var array
53 | */
54 | protected $routeMiddleware = [
55 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
56 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
57 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
58 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
59 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
60 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
61 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
62 | ];
63 | }
64 |
--------------------------------------------------------------------------------
/app/backend/app/Http/Middleware/AccessControlAllowOrigin.php:
--------------------------------------------------------------------------------
1 | header('Access-Control-Allow-Origin', '*');
20 | $response->header('Access-Control-Allow-Headers', 'Origin, Content-Type, Cookie, Accept, Token, Authorization');
21 | $response->header('Access-Control-Allow-Methods', 'GET, POST, PATCH, PUT, OPTIONS');
22 | if ($request->method() === 'OPTIONS') {
23 | response('OPTIONS FILTER', 200, [
24 | 'Access-Control-Allow-Origin' => '*',
25 | 'Access-Control-Allow-Headers' => 'Origin, Content-Type, Cookie, Accept, Token, Authorization',
26 | 'Access-Control-Allow-Methods' => 'GET, POST, PATCH, PUT, OPTIONS',
27 | ])->send();
28 | }
29 | return $response;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/backend/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect('/home');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/backend/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 | '任务ID',
50 | 'removable' => false//是否可以删除
51 | ];
52 |
53 | }
54 |
55 | }
--------------------------------------------------------------------------------
/app/backend/app/Models/ProjectPlugin.php:
--------------------------------------------------------------------------------
1 | '应用民名称'],
23 | ['title', '名称', 'array', ['cn' => '任务', 'en' => '']],
24 | ['description', '描述', 'array', ['cn' => '', 'en' => '']],
25 | ['sort', '排序', 'int', 1],
26 | ['type', '应用类型:0应用,1插件', 'select', '0|1']
27 | ];
28 | }
--------------------------------------------------------------------------------
/app/backend/app/Models/SmartStage.php:
--------------------------------------------------------------------------------
1 | {$this->uniqueName};
50 | }
51 |
52 | /**
53 | * Return a key value array, containing any custom claims to be added to the JWT.
54 | *
55 | * @return array
56 | */
57 | public function getJWTCustomClaims()
58 | {
59 | return [];
60 | }
61 |
62 | /**
63 | * Get the name of the unique identifier for the user.
64 | *
65 | * @return string
66 | */
67 | public function getAuthIdentifierName()
68 | {
69 | return $this->uniqueName;
70 | }
71 |
72 | /**
73 | * Get the unique identifier for the user.
74 | *
75 | * @return mixed
76 | */
77 | public function getAuthIdentifier()
78 | {
79 | return $this->{$this->uniqueName};
80 | }
81 |
82 | /**
83 | * Get the password for the user.
84 | *
85 | * @return string
86 | */
87 | public function getAuthPassword()
88 | {
89 | return $this->password;
90 | }
91 |
92 | /**
93 | * Get the token value for the "remember me" session.
94 | *
95 | * @return string
96 | */
97 | public function getRememberToken()
98 | {
99 | return $this->{$this->rememberTokenName};
100 | }
101 |
102 | /**
103 | * Set the token value for the "remember me" session.
104 | *
105 | * @param string $value
106 | * @return void
107 | */
108 | public function setRememberToken($value)
109 | {
110 | $this->{$this->rememberTokenName} = $value;
111 | }
112 |
113 | /**
114 | * Get the column name for the "remember me" token.
115 | *
116 | * @return string
117 | */
118 | public function getRememberTokenName()
119 | {
120 | return $this->rememberTokenName;
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/app/backend/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
19 | ];
20 |
21 | /**
22 | * Register any authentication / authorization services.
23 | *
24 | * @return void
25 | */
26 | public function boot()
27 | {
28 | $this->registerPolicies();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/backend/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
17 | 'App\Listeners\EventListener',
18 | ],
19 | ];
20 |
21 | /**
22 | * Register any events for your application.
23 | *
24 | * @return void
25 | */
26 | public function boot()
27 | {
28 | parent::boot();
29 |
30 | //
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/backend/app/Providers/MyUserProvider.php:
--------------------------------------------------------------------------------
1 | mapApiRoutes();
39 |
40 | $this->mapWebRoutes();
41 |
42 | //
43 | }
44 |
45 | /**
46 | * Define the "web" routes for the application.
47 | *
48 | * These routes all receive session state, CSRF protection, etc.
49 | *
50 | * @return void
51 | */
52 | protected function mapWebRoutes()
53 | {
54 | Route::middleware('web')
55 | ->namespace($this->namespace)
56 | ->group(base_path('routes/web.php'));
57 | }
58 |
59 | /**
60 | * Define the "api" routes for the application.
61 | *
62 | * These routes are typically stateless.
63 | *
64 | * @return void
65 | */
66 | protected function mapApiRoutes()
67 | {
68 | Route::prefix('api')
69 | ->middleware('api')
70 | ->namespace($this->namespace)
71 | ->group(base_path('routes/api.php'));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/backend/app/Repositories/ProjectRepository.php:
--------------------------------------------------------------------------------
1 | model = $model;
27 | }
28 |
29 | public function myProjects($domainType = 0)
30 | {
31 | $user = auth()->user();
32 | return $this->model
33 | ->where('_creator_id', $user['_id'])
34 | ->orderBy('create_at', 'desc');//创建时间排序
35 | }
36 |
37 | public function where($where)
38 | {
39 | return $this->model->where($where);
40 | }
41 |
42 | public function createProject()
43 | {
44 | $user = auth()->user();
45 | $project = new Project();
46 | $project->_creator_id = $user['_id'];
47 | $project->creator = [
48 | '_id' => $user['_id'],
49 | 'name' => $user['username'],
50 | 'avatar_url' => $user['avatar_url']
51 | ];
52 | $project->title = request('title');
53 | $project->description = request('description');
54 | $project->logo = request('logo');
55 |
56 | //模板ID
57 | $project->template_id = request('template_id');
58 | $project->is_public = true;
59 | $project->task_types = [];
60 | $project->applications = [];//应用
61 | $project->tags = [];
62 | $project->transferable = false;
63 | $project->status = 1;
64 |
65 |
66 | /*初始化应用程序*/
67 | $project->save();
68 | $this->_afterCreateProject($project);
69 | return $project;
70 |
71 | }
72 |
73 | private function _afterCreateProject(Project $project)
74 | {
75 | //专业模板,创建一个2个TaskGroup
76 | #region
77 | if ($project->template_id === 0) {
78 | //迭代面板
79 | $taskGroupSprint = new TaskGroup([
80 | '_project_id' => $project->_id,
81 | '_creator_id' => $project->_creator_id,
82 | 'name' => 'sprint',
83 | 'view' => [
84 | 'type' => 'sprint'
85 | ],
86 | 'type' => 'sprint',
87 | 'description' => '',
88 | 'filter' => 'sprint_status = active',
89 | ]);
90 | $taskGroupSprint->save();
91 |
92 | //需求
93 | $taskGroupStory = new TaskGroup([
94 | '_project_id' => $project->_id,
95 | '_creator_id' => $project->_creator_id,
96 | 'name' => 'story',
97 | 'view' => [
98 | 'type' => 'story'
99 | ],
100 | 'type' => 'story',
101 | 'description' => '',
102 | 'filter' => 'task_type = story',
103 | ]);
104 | $taskGroupStory->save();
105 |
106 | //缺陷
107 | $taskGroupBug = new TaskGroup([
108 | '_project_id' => $project->_id,
109 | '_creator_id' => $project->_creator_id,
110 | 'name' => 'bug',
111 | 'view' => [
112 | 'type' => 'bug'
113 | ],
114 | 'type' => 'bug',
115 | 'description' => '',
116 | 'filter' => 'task_type = bug',
117 | ]);
118 | $taskGroupBug->save();
119 | }
120 | #endregion
121 | #region /*创建一个任务列表*/
122 | $taskList = new TaskList([
123 | '_project_id' => $project->_id,
124 | '_creator_id' => $project->_creator_id,
125 | 'title' => '任务',
126 | 'stage_ids' => [],
127 | 'smarty_group' => 0
128 | ]);
129 | $taskList->save();
130 | #endregion
131 |
132 |
133 | //#region 初始化阶段信息
134 | $stages = [
135 | [
136 | 'name' => '待处理',
137 | 'is_archived' => false,
138 | 'sort' => 0
139 | ],
140 | [
141 | 'name' => '开发中',
142 | 'is_archived' => false,
143 | 'sort' => 1
144 | ],
145 | [
146 | 'name' => '测试中',
147 | 'is_archived' => false,
148 | 'sort' => 2
149 | ],
150 | [
151 | 'name' => '已完成',
152 | 'is_archived' => false,
153 | 'sort' => 3
154 | ],
155 | ];
156 | foreach ($stages as $stage) {
157 | $newStage = new TaskStage(array_merge($stage,
158 | [
159 | '_project_id' => $project->_id,
160 | '_creator_id' => $project->_creator_id,
161 | '_task_list_id' => $taskList->_id
162 | ]
163 | ));
164 | $newStage->save();
165 |
166 |
167 | //#region 给阶段初始化一些任务
168 | $newTask = new Task([
169 | '_creator_id' => $project->_creator_id,
170 | '_project_id' => $project->_id,
171 | '_stage_id' => $newStage->_id,
172 | '_task_list_id' => $taskList->_id,
173 | 'title' => '敏捷开发任务模板',
174 | 'mark' => '',
175 | 'note' => '',
176 | 'status' => 1
177 | ]);
178 | $newTask->save();
179 | //#endregion
180 |
181 |
182 | //更新TaskList
183 | $taskList->push('stage_ids', $newStage->_id);
184 |
185 | $taskList->save();
186 | }
187 |
188 | //#endrgion 初始化阶段信息
189 |
190 | }
191 |
192 | private function _initTpl(Project &$project)
193 | {
194 |
195 | return $project;
196 | }
197 | }
--------------------------------------------------------------------------------
/app/backend/app/Repositories/Repository.php:
--------------------------------------------------------------------------------
1 | model;
21 | }
22 |
23 | public function setModel(Model $model)
24 | {
25 | $this->model = $model;
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/app/backend/app/Repositories/TaskRepository.php:
--------------------------------------------------------------------------------
1 | model = $taskModel;
20 | }
21 |
22 | public function myTasks(User $user)
23 | {
24 | return $this->model->where('_creator_id', $user->_id);
25 | }
26 | }
--------------------------------------------------------------------------------
/app/backend/app/Repositories/UserRepository.php:
--------------------------------------------------------------------------------
1 | user = $user;
25 | }
26 |
27 | public function getUser()
28 | {
29 |
30 | }
31 |
32 | }
--------------------------------------------------------------------------------
/app/backend/app/Services/UserService.php:
--------------------------------------------------------------------------------
1 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/app/backend/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 |
56 | return $app;
57 |
--------------------------------------------------------------------------------
/app/backend/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/app/backend/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "description": "The Laravel Framework.",
4 | "keywords": ["framework", "laravel"],
5 | "license": "MIT",
6 | "type": "project",
7 | "require": {
8 | "php": ">=7.1.3",
9 | "dingo/api": "v2.0.0-alpha2",
10 | "fideloper/proxy": "~4.0",
11 | "jenssegers/mongodb": "^3.4",
12 | "laravel/framework": "5.6.*",
13 | "laravel/tinker": "~1.0",
14 | "tymon/jwt-auth": "1.0.*"
15 | },
16 | "require-dev": {
17 | "barryvdh/laravel-ide-helper": "^2.4",
18 | "filp/whoops": "~2.0",
19 | "fzaninotto/faker": "^1.7",
20 | "mockery/mockery": "~1.0",
21 | "nunomaduro/collision": "~2.0",
22 | "phpunit/phpunit": "~7.0",
23 | "symfony/thanks": "^1.0"
24 | },
25 | "autoload": {
26 | "classmap": [
27 | "database/seeds",
28 | "database/factories"
29 | ],
30 | "psr-4": {
31 | "App\\": "app/"
32 | }
33 | },
34 | "autoload-dev": {
35 | "psr-4": {
36 | "Tests\\": "tests/"
37 | }
38 | },
39 | "extra": {
40 | "laravel": {
41 | "dont-discover": [
42 | ]
43 | }
44 | },
45 | "scripts": {
46 | "post-root-package-install": [
47 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
48 | ],
49 | "post-create-project-cmd": [
50 | "@php artisan key:generate"
51 | ],
52 | "post-autoload-dump": [
53 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
54 | "@php artisan package:discover"
55 | ]
56 | },
57 | "config": {
58 | "preferred-install": "dist",
59 | "sort-packages": true,
60 | "optimize-autoloader": true
61 | },
62 | "minimum-stability": "dev",
63 | "prefer-stable": true
64 | }
65 |
--------------------------------------------------------------------------------
/app/backend/config/api.php:
--------------------------------------------------------------------------------
1 | env('API_STANDARDS_TREE', 'x'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | API Subtype
26 | |--------------------------------------------------------------------------
27 | |
28 | | Your subtype will follow the standards tree you use when used in the
29 | | "Accept" header to negotiate the content type and version.
30 | |
31 | | For example: Accept: application/x.SUBTYPE.v1+json
32 | |
33 | */
34 |
35 | 'subtype' => env('API_SUBTYPE', ''),
36 |
37 | /*
38 | |--------------------------------------------------------------------------
39 | | Default API Version
40 | |--------------------------------------------------------------------------
41 | |
42 | | This is the default version when strict mode is disabled and your API
43 | | is accessed via a web browser. It's also used as the default version
44 | | when generating your APIs documentation.
45 | |
46 | */
47 |
48 | 'version' => env('API_VERSION', 'v1'),
49 |
50 | /*
51 | |--------------------------------------------------------------------------
52 | | Default API Prefix
53 | |--------------------------------------------------------------------------
54 | |
55 | | A default prefix to use for your API routes so you don't have to
56 | | specify it for each group.
57 | |
58 | */
59 |
60 | 'prefix' => env('API_PREFIX', null),
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Default API Domain
65 | |--------------------------------------------------------------------------
66 | |
67 | | A default domain to use for your API routes so you don't have to
68 | | specify it for each group.
69 | |
70 | */
71 |
72 | 'domain' => env('API_DOMAIN', null),
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Name
77 | |--------------------------------------------------------------------------
78 | |
79 | | When documenting your API using the API Blueprint syntax you can
80 | | configure a default name to avoid having to manually specify
81 | | one when using the command.
82 | |
83 | */
84 |
85 | 'name' => env('API_NAME', null),
86 |
87 | /*
88 | |--------------------------------------------------------------------------
89 | | Conditional Requests
90 | |--------------------------------------------------------------------------
91 | |
92 | | Globally enable conditional requests so that an ETag header is added to
93 | | any successful response. Subsequent requests will perform a check and
94 | | will return a 304 Not Modified. This can also be enabled or disabled
95 | | on certain groups or routes.
96 | |
97 | */
98 |
99 | 'conditionalRequest' => env('API_CONDITIONAL_REQUEST', true),
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Strict Mode
104 | |--------------------------------------------------------------------------
105 | |
106 | | Enabling strict mode will require clients to send a valid Accept header
107 | | with every request. This also voids the default API version, meaning
108 | | your API will not be browsable via a web browser.
109 | |
110 | */
111 |
112 | 'strict' => env('API_STRICT', false),
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Debug Mode
117 | |--------------------------------------------------------------------------
118 | |
119 | | Enabling debug mode will result in error responses caused by thrown
120 | | exceptions to have a "debug" key that will be populated with
121 | | more detailed information on the exception.
122 | |
123 | */
124 |
125 | 'debug' => env('API_DEBUG', false),
126 |
127 | /*
128 | |--------------------------------------------------------------------------
129 | | Generic Error Format
130 | |--------------------------------------------------------------------------
131 | |
132 | | When some HTTP exceptions are not caught and dealt with the API will
133 | | generate a generic error response in the format provided. Any
134 | | keys that aren't replaced with corresponding values will be
135 | | removed from the final response.
136 | |
137 | */
138 |
139 | 'errorFormat' => [
140 | 'message' => ':message',
141 | 'errors' => ':errors',
142 | 'code' => ':code',
143 | 'status_code' => ':status_code',
144 | 'debug' => ':debug',
145 | ],
146 |
147 | /*
148 | |--------------------------------------------------------------------------
149 | | API Middleware
150 | |--------------------------------------------------------------------------
151 | |
152 | | Middleware that will be applied globally to all API requests.
153 | |
154 | */
155 |
156 | 'middleware' => [
157 |
158 | ],
159 |
160 | /*
161 | |--------------------------------------------------------------------------
162 | | Authentication Providers
163 | |--------------------------------------------------------------------------
164 | |
165 | | The authentication providers that should be used when attempting to
166 | | authenticate an incoming API request.
167 | |
168 | */
169 |
170 | 'auth' => [
171 | 'jwt' => 'Dingo\Api\Auth\Provider\JWT',
172 | ],
173 |
174 | /*
175 | |--------------------------------------------------------------------------
176 | | Throttling / Rate Limiting
177 | |--------------------------------------------------------------------------
178 | |
179 | | Consumers of your API can be limited to the amount of requests they can
180 | | make. You can create your own throttles or simply change the default
181 | | throttles.
182 | |
183 | */
184 |
185 | 'throttling' => [
186 |
187 | ],
188 |
189 | /*
190 | |--------------------------------------------------------------------------
191 | | Response Transformer
192 | |--------------------------------------------------------------------------
193 | |
194 | | Responses can be transformed so that they are easier to format. By
195 | | default a Fractal transformer will be used to transform any
196 | | responses prior to formatting. You can easily replace
197 | | this with your own transformer.
198 | |
199 | */
200 |
201 | 'transformer' => env('API_TRANSFORMER', Dingo\Api\Transformer\Adapter\Fractal::class),
202 |
203 | /*
204 | |--------------------------------------------------------------------------
205 | | Response Formats
206 | |--------------------------------------------------------------------------
207 | |
208 | | Responses can be returned in multiple formats by registering different
209 | | response formatters. You can also customize an existing response
210 | | formatter with a number of options to configure its output.
211 | |
212 | */
213 |
214 | 'defaultFormat' => env('API_DEFAULT_FORMAT', 'json'),
215 |
216 | 'formats' => [
217 | 'json' => Dingo\Api\Http\Response\Format\Json::class
218 | ],
219 |
220 | 'formatsOptions' => [
221 | 'json' => [
222 | 'pretty_print' => env('API_JSON_FORMAT_PRETTY_PRINT_ENABLED', false),
223 | 'indent_style' => env('API_JSON_FORMAT_INDENT_STYLE', 'space'),
224 | 'indent_size' => env('API_JSON_FORMAT_INDENT_SIZE', 2),
225 | ],
226 |
227 | ],
228 |
229 | ];
230 |
--------------------------------------------------------------------------------
/app/backend/config/app.php:
--------------------------------------------------------------------------------
1 | env('APP_NAME', 'Laravel'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Application Environment
21 | |--------------------------------------------------------------------------
22 | |
23 | | This value determines the "environment" your application is currently
24 | | running in. This may determine how you prefer to configure various
25 | | services your application utilizes. Set this in your ".env" file.
26 | |
27 | */
28 |
29 | 'env' => env('APP_ENV', 'production'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Application Debug Mode
34 | |--------------------------------------------------------------------------
35 | |
36 | | When your application is in debug mode, detailed error messages with
37 | | stack traces will be shown on every error that occurs within your
38 | | application. If disabled, a simple generic error page is shown.
39 | |
40 | */
41 |
42 | 'debug' => env('APP_DEBUG', true),
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Application URL
47 | |--------------------------------------------------------------------------
48 | |
49 | | This URL is used by the console to properly generate URLs when using
50 | | the Artisan command line tool. You should set this to the root of
51 | | your application so that it is used when running Artisan tasks.
52 | |
53 | */
54 |
55 | 'url' => env('APP_URL', 'http://team.oeyteam.com'),
56 |
57 | /*
58 | |--------------------------------------------------------------------------
59 | | Application Timezone
60 | |--------------------------------------------------------------------------
61 | |
62 | | Here you may specify the default timezone for your application, which
63 | | will be used by the PHP date and date-time functions. We have gone
64 | | ahead and set this to a sensible default for you out of the box.
65 | |
66 | */
67 |
68 | 'timezone' => 'Asia/Shanghai',
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Application Locale Configuration
73 | |--------------------------------------------------------------------------
74 | |
75 | | The application locale determines the default locale that will be used
76 | | by the translation service provider. You are free to set this value
77 | | to any of the locales which will be supported by the application.
78 | |
79 | */
80 |
81 | 'locale' => 'cn',
82 |
83 | /*
84 | |--------------------------------------------------------------------------
85 | | Application Fallback Locale
86 | |--------------------------------------------------------------------------
87 | |
88 | | The fallback locale determines the locale to use when the current one
89 | | is not available. You may change the value to correspond to any of
90 | | the language folders that are provided through your application.
91 | |
92 | */
93 |
94 | 'fallback_locale' => 'en',
95 |
96 | /*
97 | |--------------------------------------------------------------------------
98 | | Encryption Key
99 | |--------------------------------------------------------------------------
100 | |
101 | | This key is used by the Illuminate encrypter service and should be set
102 | | to a random, 32 character string, otherwise these encrypted strings
103 | | will not be safe. Please do this before deploying an application!
104 | |
105 | */
106 |
107 | 'key' => env('APP_KEY'),
108 |
109 | 'cipher' => 'AES-256-CBC',
110 |
111 | /*
112 | |--------------------------------------------------------------------------
113 | | Autoloaded Service Providers
114 | |--------------------------------------------------------------------------
115 | |
116 | | The service providers listed here will be automatically loaded on the
117 | | request to your application. Feel free to add your own services to
118 | | this array to grant expanded functionality to your applications.
119 | |
120 | */
121 |
122 | 'providers' => [
123 |
124 | /*
125 | * Laravel Framework Service Providers...
126 | */
127 | Illuminate\Auth\AuthServiceProvider::class,
128 | Illuminate\Broadcasting\BroadcastServiceProvider::class,
129 | Illuminate\Bus\BusServiceProvider::class,
130 | Illuminate\Cache\CacheServiceProvider::class,
131 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
132 | Illuminate\Cookie\CookieServiceProvider::class,
133 | Illuminate\Database\DatabaseServiceProvider::class,
134 | Illuminate\Encryption\EncryptionServiceProvider::class,
135 | Illuminate\Filesystem\FilesystemServiceProvider::class,
136 | Illuminate\Foundation\Providers\FoundationServiceProvider::class,
137 | Illuminate\Hashing\HashServiceProvider::class,
138 | Illuminate\Mail\MailServiceProvider::class,
139 | Illuminate\Notifications\NotificationServiceProvider::class,
140 | Illuminate\Pagination\PaginationServiceProvider::class,
141 | Illuminate\Pipeline\PipelineServiceProvider::class,
142 | Illuminate\Queue\QueueServiceProvider::class,
143 | Illuminate\Redis\RedisServiceProvider::class,
144 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
145 | Illuminate\Session\SessionServiceProvider::class,
146 | Illuminate\Translation\TranslationServiceProvider::class,
147 | Illuminate\Validation\ValidationServiceProvider::class,
148 | Illuminate\View\ViewServiceProvider::class,
149 |
150 | /*
151 | * Package Service Providers...
152 | */
153 | Jenssegers\Mongodb\MongodbServiceProvider::class,
154 | Jenssegers\Mongodb\Auth\PasswordResetServiceProvider::class,
155 |
156 |
157 | Tymon\JWTAuth\Providers\LaravelServiceProvider::class,
158 |
159 |
160 | /*
161 | * Application Service Providers...
162 | */
163 | App\Providers\AppServiceProvider::class,
164 | App\Providers\AuthServiceProvider::class,
165 | // App\Providers\BroadcastServiceProvider::class,
166 | App\Providers\EventServiceProvider::class,
167 | App\Providers\RouteServiceProvider::class,
168 |
169 | ],
170 |
171 | /*
172 | |--------------------------------------------------------------------------
173 | | Class Aliases
174 | |--------------------------------------------------------------------------
175 | |
176 | | This array of class aliases will be registered when this application
177 | | is started. However, feel free to register as many as you wish as
178 | | the aliases are "lazy" loaded so they don't hinder performance.
179 | |
180 | */
181 |
182 | 'aliases' => [
183 |
184 | 'App' => Illuminate\Support\Facades\App::class,
185 | 'Artisan' => Illuminate\Support\Facades\Artisan::class,
186 | 'Auth' => Illuminate\Support\Facades\Auth::class,
187 | 'Blade' => Illuminate\Support\Facades\Blade::class,
188 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
189 | 'Bus' => Illuminate\Support\Facades\Bus::class,
190 | 'Cache' => Illuminate\Support\Facades\Cache::class,
191 | 'Config' => Illuminate\Support\Facades\Config::class,
192 | 'Cookie' => Illuminate\Support\Facades\Cookie::class,
193 | 'Crypt' => Illuminate\Support\Facades\Crypt::class,
194 | 'DB' => Illuminate\Support\Facades\DB::class,
195 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
196 | 'Event' => Illuminate\Support\Facades\Event::class,
197 | 'File' => Illuminate\Support\Facades\File::class,
198 | 'Gate' => Illuminate\Support\Facades\Gate::class,
199 | 'Hash' => Illuminate\Support\Facades\Hash::class,
200 | 'Lang' => Illuminate\Support\Facades\Lang::class,
201 | 'Log' => Illuminate\Support\Facades\Log::class,
202 | 'Mail' => Illuminate\Support\Facades\Mail::class,
203 | 'Notification' => Illuminate\Support\Facades\Notification::class,
204 | 'Password' => Illuminate\Support\Facades\Password::class,
205 | 'Queue' => Illuminate\Support\Facades\Queue::class,
206 | 'Redirect' => Illuminate\Support\Facades\Redirect::class,
207 | 'Redis' => Illuminate\Support\Facades\Redis::class,
208 | 'Request' => Illuminate\Support\Facades\Request::class,
209 | 'Response' => Illuminate\Support\Facades\Response::class,
210 | 'Route' => Illuminate\Support\Facades\Route::class,
211 | 'Schema' => Illuminate\Support\Facades\Schema::class,
212 | 'Session' => Illuminate\Support\Facades\Session::class,
213 | 'Storage' => Illuminate\Support\Facades\Storage::class,
214 | 'URL' => Illuminate\Support\Facades\URL::class,
215 | 'Validator' => Illuminate\Support\Facades\Validator::class,
216 | 'View' => Illuminate\Support\Facades\View::class,
217 |
218 | 'Moloquent' => 'Jenssegers\Mongodb\Eloquent\Model',
219 | ],
220 |
221 | ];
222 |
--------------------------------------------------------------------------------
/app/backend/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'api',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session", "token"
35 | |
36 | */
37 |
38 |
39 | //守卫
40 | 'guards' => [
41 | 'web' => [
42 | 'driver' => 'session',
43 | 'provider' => 'users',
44 | ],
45 | 'api' => [
46 | 'driver' => 'jwt',//JWT
47 | 'provider' => 'users',
48 | ],
49 | ],
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | User Providers
54 | |--------------------------------------------------------------------------
55 | |
56 | | All authentication drivers have a user provider. This defines how the
57 | | users are actually retrieved out of your database or other storage
58 | | mechanisms used by this application to persist your user's data.
59 | |
60 | | If you have multiple user tables or models you may configure multiple
61 | | sources which represent each model / table. These sources may then
62 | | be assigned to any extra authentication guards you have defined.
63 | |
64 | | Supported: "database", "eloquent"
65 | |
66 | */
67 |
68 | 'providers' => [
69 | 'users' => [
70 | 'driver' => 'eloquent',
71 | 'model' => \App\Models\User::class,
72 | ],
73 |
74 | // 'users' => [
75 | // 'driver' => 'database',
76 | // 'table' => 'users',
77 | // ],
78 | ],
79 |
80 | /*
81 | |--------------------------------------------------------------------------
82 | | Resetting Passwords
83 | |--------------------------------------------------------------------------
84 | |
85 | | You may specify multiple password reset configurations if you have more
86 | | than one user table or model in the application and you want to have
87 | | separate password reset settings based on the specific user types.
88 | |
89 | | The expire time is the number of minutes that the reset token should be
90 | | considered valid. This security feature keeps tokens short-lived so
91 | | they have less time to be guessed. You may change this as needed.
92 | |
93 | */
94 |
95 | 'passwords' => [
96 | 'users' => [
97 | 'provider' => 'users',
98 | 'table' => 'password_resets',
99 | 'expire' => 60,
100 | ],
101 | ],
102 |
103 | ];
104 |
--------------------------------------------------------------------------------
/app/backend/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'encrypted' => true,
41 | ],
42 | ],
43 |
44 | 'redis' => [
45 | 'driver' => 'redis',
46 | 'connection' => 'default',
47 | ],
48 |
49 | 'log' => [
50 | 'driver' => 'log',
51 | ],
52 |
53 | 'null' => [
54 | 'driver' => 'null',
55 | ],
56 |
57 | ],
58 |
59 | ];
60 |
--------------------------------------------------------------------------------
/app/backend/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Cache Stores
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the cache "stores" for your application as
26 | | well as their drivers. You may even define multiple stores for the
27 | | same cache driver to group types of items stored in your caches.
28 | |
29 | */
30 |
31 | 'stores' => [
32 |
33 | 'apc' => [
34 | 'driver' => 'apc',
35 | ],
36 |
37 | 'array' => [
38 | 'driver' => 'array',
39 | ],
40 |
41 | 'database' => [
42 | 'driver' => 'database',
43 | 'table' => 'cache',
44 | 'connection' => null,
45 | ],
46 |
47 | 'file' => [
48 | 'driver' => 'file',
49 | 'path' => storage_path('framework/cache/data'),
50 | ],
51 |
52 | 'memcached' => [
53 | 'driver' => 'memcached',
54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
55 | 'sasl' => [
56 | env('MEMCACHED_USERNAME'),
57 | env('MEMCACHED_PASSWORD'),
58 | ],
59 | 'options' => [
60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
61 | ],
62 | 'servers' => [
63 | [
64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
65 | 'port' => env('MEMCACHED_PORT', 11211),
66 | 'weight' => 100,
67 | ],
68 | ],
69 | ],
70 |
71 | 'redis' => [
72 | 'driver' => 'redis',
73 | 'connection' => 'default',
74 | ],
75 |
76 | ],
77 |
78 | /*
79 | |--------------------------------------------------------------------------
80 | | Cache Key Prefix
81 | |--------------------------------------------------------------------------
82 | |
83 | | When utilizing a RAM based store such as APC or Memcached, there might
84 | | be other applications utilizing the same cache. So, we'll specify a
85 | | value to get prefixed to all our keys so we can avoid collisions.
86 | |
87 | */
88 |
89 | 'prefix' => env(
90 | 'CACHE_PREFIX',
91 | str_slug(env('APP_NAME', 'laravel'), '_').'_cache'
92 | ),
93 |
94 | ];
95 |
--------------------------------------------------------------------------------
/app/backend/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'mongodb'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Database Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here are each of the database connections setup for your application.
24 | | Of course, examples of configuring each database platform that is
25 | | supported by Laravel is shown below to make development simple.
26 | |
27 | |
28 | | All database work in Laravel is done through the PHP PDO facilities
29 | | so make sure you have the driver for your particular database of
30 | | choice installed on your machine before you begin development.
31 | |
32 | */
33 |
34 | 'connections' => [
35 | 'mongodb' => [
36 | 'driver' => 'mongodb',
37 | 'host' => 'mongo-db',
38 | 'port' => 27017,
39 | 'database' => 'oeyteam',
40 | 'username' => '',
41 | 'password' => '',
42 | ],
43 |
44 | 'sqlite' => [
45 | 'driver' => 'sqlite',
46 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
47 | 'prefix' => '',
48 | ],
49 |
50 | 'mysql' => [
51 | 'driver' => 'mysql',
52 | 'host' => env('DB_HOST', 'mysql-db'),
53 | 'port' => env('DB_PORT', '3306'),
54 | 'database' => env('DB_DATABASE', 'package_v1'),
55 | 'username' => env('DB_USERNAME', 'zhaojun'),
56 | 'password' => env('DB_PASSWORD', 'zhaojun'),
57 | 'unix_socket' => env('DB_SOCKET', ''),
58 | 'charset' => 'utf8mb4',
59 | 'collation' => 'utf8mb4_unicode_ci',
60 | 'prefix' => 'team_',
61 | 'strict' => true,
62 | 'engine' => null,
63 | ],
64 |
65 | 'pgsql' => [
66 | 'driver' => 'pgsql',
67 | 'host' => env('DB_HOST', '127.0.0.1'),
68 | 'port' => env('DB_PORT', '5432'),
69 | 'database' => env('DB_DATABASE', 'forge'),
70 | 'username' => env('DB_USERNAME', 'forge'),
71 | 'password' => env('DB_PASSWORD', ''),
72 | 'charset' => 'utf8',
73 | 'prefix' => '',
74 | 'schema' => 'public',
75 | 'sslmode' => 'prefer',
76 | ],
77 |
78 | 'sqlsrv' => [
79 | 'driver' => 'sqlsrv',
80 | 'host' => env('DB_HOST', 'localhost'),
81 | 'port' => env('DB_PORT', '1433'),
82 | 'database' => env('DB_DATABASE', 'forge'),
83 | 'username' => env('DB_USERNAME', 'forge'),
84 | 'password' => env('DB_PASSWORD', ''),
85 | 'charset' => 'utf8',
86 | 'prefix' => '',
87 | ],
88 |
89 | ],
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Migration Repository Table
94 | |--------------------------------------------------------------------------
95 | |
96 | | This table keeps track of all the migrations that have already run for
97 | | your application. Using this information, we can determine which of
98 | | the migrations on disk haven't actually been run in the database.
99 | |
100 | */
101 |
102 | 'migrations' => 'migrations',
103 |
104 | /*
105 | |--------------------------------------------------------------------------
106 | | Redis Databases
107 | |--------------------------------------------------------------------------
108 | |
109 | | Redis is an open source, fast, and advanced key-value store that also
110 | | provides a richer set of commands than a typical key-value systems
111 | | such as APC or Memcached. Laravel makes it easy to dig right in.
112 | |
113 | */
114 |
115 | 'redis' => [
116 |
117 | 'client' => 'predis',
118 |
119 | 'default' => [
120 | 'host' => env('REDIS_HOST', '127.0.0.1'),
121 | 'password' => env('REDIS_PASSWORD', null),
122 | 'port' => env('REDIS_PORT', 6379),
123 | 'database' => 0,
124 | ],
125 |
126 | ],
127 |
128 | ];
129 |
--------------------------------------------------------------------------------
/app/backend/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DRIVER', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Cloud Filesystem Disk
21 | |--------------------------------------------------------------------------
22 | |
23 | | Many applications store files both locally and in the cloud. For this
24 | | reason, you may specify a default "cloud" driver here. This driver
25 | | will be bound as the Cloud disk implementation in the container.
26 | |
27 | */
28 |
29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Filesystem Disks
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here you may configure as many filesystem "disks" as you wish, and you
37 | | may even configure multiple disks of the same driver. Defaults have
38 | | been setup for each driver as an example of the required options.
39 | |
40 | | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path('app'),
49 | ],
50 |
51 | 'public' => [
52 | 'driver' => 'local',
53 | 'root' => storage_path('app/public'),
54 | 'url' => env('APP_URL').'/storage',
55 | 'visibility' => 'public',
56 | ],
57 |
58 | 's3' => [
59 | 'driver' => 's3',
60 | 'key' => env('AWS_ACCESS_KEY_ID'),
61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
62 | 'region' => env('AWS_DEFAULT_REGION'),
63 | 'bucket' => env('AWS_BUCKET'),
64 | 'url' => env('AWS_URL'),
65 | ],
66 |
67 | ],
68 |
69 | ];
70 |
--------------------------------------------------------------------------------
/app/backend/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | ];
21 |
--------------------------------------------------------------------------------
/app/backend/config/jwt.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | return [
13 |
14 | /*
15 | |--------------------------------------------------------------------------
16 | | JWT Authentication Secret
17 | |--------------------------------------------------------------------------
18 | |
19 | | Don't forget to set this in your .env file, as it will be used to sign
20 | | your tokens. A helper command is provided for this:
21 | | `php artisan jwt:secret`
22 | |
23 | | Note: This will be used for Symmetric algorithms only (HMAC),
24 | | since RSA and ECDSA use a private/public key combo (See below).
25 | |
26 | */
27 |
28 | 'secret' => env('JWT_SECRET'),
29 |
30 | /*
31 | |--------------------------------------------------------------------------
32 | | JWT Authentication Keys
33 | |--------------------------------------------------------------------------
34 | |
35 | | The algorithm you are using, will determine whether your tokens are
36 | | signed with a random string (defined in `JWT_SECRET`) or using the
37 | | following public & private keys.
38 | |
39 | | Symmetric Algorithms:
40 | | HS256, HS384 & HS512 will use `JWT_SECRET`.
41 | |
42 | | Asymmetric Algorithms:
43 | | RS256, RS384 & RS512 / ES256, ES384 & ES512 will use the keys below.
44 | |
45 | */
46 |
47 | 'keys' => [
48 |
49 | /*
50 | |--------------------------------------------------------------------------
51 | | Public Key
52 | |--------------------------------------------------------------------------
53 | |
54 | | A path or resource to your public key.
55 | |
56 | | E.g. 'file://path/to/public/key'
57 | |
58 | */
59 |
60 | 'public' => env('JWT_PUBLIC_KEY'),
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Private Key
65 | |--------------------------------------------------------------------------
66 | |
67 | | A path or resource to your private key.
68 | |
69 | | E.g. 'file://path/to/private/key'
70 | |
71 | */
72 |
73 | 'private' => env('JWT_PRIVATE_KEY'),
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Passphrase
78 | |--------------------------------------------------------------------------
79 | |
80 | | The passphrase for your private key. Can be null if none set.
81 | |
82 | */
83 |
84 | 'passphrase' => env('JWT_PASSPHRASE'),
85 |
86 | ],
87 |
88 | /*
89 | |--------------------------------------------------------------------------
90 | | JWT time to live
91 | |--------------------------------------------------------------------------
92 | |
93 | | Specify the length of time (in minutes) that the token will be valid for.
94 | | Defaults to 1 hour.
95 | |
96 | | You can also set this to null, to yield a never expiring token.
97 | | Some people may want this behaviour for e.g. a mobile app.
98 | | This is not particularly recommended, so make sure you have appropriate
99 | | systems in place to revoke the token if necessary.
100 | |
101 | */
102 |
103 | 'ttl' => env('JWT_TTL', 60),
104 |
105 | /*
106 | |--------------------------------------------------------------------------
107 | | Refresh time to live
108 | |--------------------------------------------------------------------------
109 | |
110 | | Specify the length of time (in minutes) that the token can be refreshed
111 | | within. I.E. The user can refresh their token within a 2 week window of
112 | | the original token being created until they must re-authenticate.
113 | | Defaults to 2 weeks.
114 | |
115 | | You can also set this to null, to yield an infinite refresh time.
116 | | Some may want this instead of never expiring tokens for e.g. a mobile app.
117 | | This is not particularly recommended, so make sure you have appropriate
118 | | systems in place to revoke the token if necessary.
119 | |
120 | */
121 |
122 | 'refresh_ttl' => env('JWT_REFRESH_TTL', 20160),
123 |
124 | /*
125 | |--------------------------------------------------------------------------
126 | | JWT hashing algorithm
127 | |--------------------------------------------------------------------------
128 | |
129 | | Specify the hashing algorithm that will be used to sign the token.
130 | |
131 | | See here: https://github.com/namshi/jose/tree/master/src/Namshi/JOSE/Signer/OpenSSL
132 | | for possible values.
133 | |
134 | */
135 |
136 | 'algo' => env('JWT_ALGO', 'HS256'),
137 |
138 | /*
139 | |--------------------------------------------------------------------------
140 | | Required Claims
141 | |--------------------------------------------------------------------------
142 | |
143 | | Specify the required claims that must exist in any token.
144 | | A TokenInvalidException will be thrown if any of these claims are not
145 | | present in the payload.
146 | |
147 | */
148 |
149 | 'required_claims' => [
150 | 'iss',
151 | 'iat',
152 | 'exp',
153 | 'nbf',
154 | 'sub',
155 | 'jti',
156 | ],
157 |
158 | /*
159 | |--------------------------------------------------------------------------
160 | | Persistent Claims
161 | |--------------------------------------------------------------------------
162 | |
163 | | Specify the claim keys to be persisted when refreshing a token.
164 | | `sub` and `iat` will automatically be persisted, in
165 | | addition to the these claims.
166 | |
167 | | Note: If a claim does not exist then it will be ignored.
168 | |
169 | */
170 |
171 | 'persistent_claims' => [
172 | // 'foo',
173 | // 'bar',
174 | ],
175 |
176 | /*
177 | |--------------------------------------------------------------------------
178 | | Lock Subject
179 | |--------------------------------------------------------------------------
180 | |
181 | | This will determine whether a `prv` claim is automatically added to
182 | | the token. The purpose of this is to ensure that if you have multiple
183 | | authentication models e.g. `App\User` & `App\OtherPerson`, then we
184 | | should prevent one authentication request from impersonating another,
185 | | if 2 tokens happen to have the same id across the 2 different models.
186 | |
187 | | Under specific circumstances, you may want to disable this behaviour
188 | | e.g. if you only have one authentication model, then you would save
189 | | a little on token size.
190 | |
191 | */
192 |
193 | 'lock_subject' => true,
194 |
195 | /*
196 | |--------------------------------------------------------------------------
197 | | Leeway
198 | |--------------------------------------------------------------------------
199 | |
200 | | This property gives the jwt timestamp claims some "leeway".
201 | | Meaning that if you have any unavoidable slight clock skew on
202 | | any of your servers then this will afford you some level of cushioning.
203 | |
204 | | This applies to the claims `iat`, `nbf` and `exp`.
205 | |
206 | | Specify in seconds - only if you know you need it.
207 | |
208 | */
209 |
210 | 'leeway' => env('JWT_LEEWAY', 0),
211 |
212 | /*
213 | |--------------------------------------------------------------------------
214 | | Blacklist Enabled
215 | |--------------------------------------------------------------------------
216 | |
217 | | In order to invalidate tokens, you must have the blacklist enabled.
218 | | If you do not want or need this functionality, then set this to false.
219 | |
220 | */
221 |
222 | 'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true),
223 |
224 | /*
225 | | -------------------------------------------------------------------------
226 | | Blacklist Grace Period
227 | | -------------------------------------------------------------------------
228 | |
229 | | When multiple concurrent requests are made with the same JWT,
230 | | it is possible that some of them fail, due to token regeneration
231 | | on every request.
232 | |
233 | | Set grace period in seconds to prevent parallel request failure.
234 | |
235 | */
236 |
237 | 'blacklist_grace_period' => env('JWT_BLACKLIST_GRACE_PERIOD', 0),
238 |
239 | /*
240 | |--------------------------------------------------------------------------
241 | | Cookies encryption
242 | |--------------------------------------------------------------------------
243 | |
244 | | By default Laravel encrypt cookies for security reason.
245 | | If you decide to not decrypt cookies, you will have to configure Laravel
246 | | to not encrypt your cookie token by adding its name into the $except
247 | | array available in the middleware "EncryptCookies" provided by Laravel.
248 | | see https://laravel.com/docs/master/responses#cookies-and-encryption
249 | | for details.
250 | |
251 | | Set it to true if you want to decrypt cookies.
252 | |
253 | */
254 |
255 | 'decrypt_cookies' => false,
256 |
257 | /*
258 | |--------------------------------------------------------------------------
259 | | Providers
260 | |--------------------------------------------------------------------------
261 | |
262 | | Specify the various providers used throughout the package.
263 | |
264 | */
265 |
266 | 'providers' => [
267 |
268 | /*
269 | |--------------------------------------------------------------------------
270 | | JWT Provider
271 | |--------------------------------------------------------------------------
272 | |
273 | | Specify the provider that is used to create and decode the tokens.
274 | |
275 | */
276 |
277 | 'jwt' => Tymon\JWTAuth\Providers\JWT\Lcobucci::class,
278 |
279 | /*
280 | |--------------------------------------------------------------------------
281 | | Authentication Provider
282 | |--------------------------------------------------------------------------
283 | |
284 | | Specify the provider that is used to authenticate users.
285 | |
286 | */
287 |
288 | 'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class,
289 |
290 | /*
291 | |--------------------------------------------------------------------------
292 | | Storage Provider
293 | |--------------------------------------------------------------------------
294 | |
295 | | Specify the provider that is used to store tokens in the blacklist.
296 | |
297 | */
298 |
299 | 'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class,
300 |
301 | ],
302 |
303 | ];
304 |
--------------------------------------------------------------------------------
/app/backend/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Log Channels
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the log channels for your application. Out of
24 | | the box, Laravel uses the Monolog PHP logging library. This gives
25 | | you a variety of powerful log handlers / formatters to utilize.
26 | |
27 | | Available Drivers: "single", "daily", "slack", "syslog",
28 | | "errorlog", "custom", "stack"
29 | |
30 | */
31 |
32 | 'channels' => [
33 | 'stack' => [
34 | 'driver' => 'stack',
35 | 'channels' => ['single'],
36 | ],
37 |
38 | 'single' => [
39 | 'driver' => 'single',
40 | 'path' => storage_path('logs/laravel.log'),
41 | 'level' => 'debug',
42 | ],
43 |
44 | 'daily' => [
45 | 'driver' => 'daily',
46 | 'path' => storage_path('logs/laravel.log'),
47 | 'level' => 'debug',
48 | 'days' => 7,
49 | ],
50 |
51 | 'slack' => [
52 | 'driver' => 'slack',
53 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
54 | 'username' => 'Laravel Log',
55 | 'emoji' => ':boom:',
56 | 'level' => 'critical',
57 | ],
58 |
59 | 'syslog' => [
60 | 'driver' => 'syslog',
61 | 'level' => 'debug',
62 | ],
63 |
64 | 'errorlog' => [
65 | 'driver' => 'errorlog',
66 | 'level' => 'debug',
67 | ],
68 | ],
69 |
70 | ];
71 |
--------------------------------------------------------------------------------
/app/backend/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_DRIVER', 'smtp'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | SMTP Host Address
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may provide the host address of the SMTP server used by your
27 | | applications. A default option is provided that is compatible with
28 | | the Mailgun mail service which will provide reliable deliveries.
29 | |
30 | */
31 |
32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | SMTP Host Port
37 | |--------------------------------------------------------------------------
38 | |
39 | | This is the SMTP port used by your application to deliver e-mails to
40 | | users of the application. Like the host we have set this value to
41 | | stay compatible with the Mailgun e-mail application by default.
42 | |
43 | */
44 |
45 | 'port' => env('MAIL_PORT', 587),
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Global "From" Address
50 | |--------------------------------------------------------------------------
51 | |
52 | | You may wish for all e-mails sent by your application to be sent from
53 | | the same address. Here, you may specify a name and address that is
54 | | used globally for all e-mails that are sent by your application.
55 | |
56 | */
57 |
58 | 'from' => [
59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
60 | 'name' => env('MAIL_FROM_NAME', 'Example'),
61 | ],
62 |
63 | /*
64 | |--------------------------------------------------------------------------
65 | | E-Mail Encryption Protocol
66 | |--------------------------------------------------------------------------
67 | |
68 | | Here you may specify the encryption protocol that should be used when
69 | | the application send e-mail messages. A sensible default using the
70 | | transport layer security protocol should provide great security.
71 | |
72 | */
73 |
74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | SMTP Server Username
79 | |--------------------------------------------------------------------------
80 | |
81 | | If your SMTP server requires a username for authentication, you should
82 | | set it here. This will get used to authenticate with your server on
83 | | connection. You may also set the "password" value below this one.
84 | |
85 | */
86 |
87 | 'username' => env('MAIL_USERNAME'),
88 |
89 | 'password' => env('MAIL_PASSWORD'),
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Sendmail System Path
94 | |--------------------------------------------------------------------------
95 | |
96 | | When using the "sendmail" driver to send e-mails, we will need to know
97 | | the path to where Sendmail lives on this server. A default path has
98 | | been provided here, which will work well on most of your systems.
99 | |
100 | */
101 |
102 | 'sendmail' => '/usr/sbin/sendmail -bs',
103 |
104 | /*
105 | |--------------------------------------------------------------------------
106 | | Markdown Mail Settings
107 | |--------------------------------------------------------------------------
108 | |
109 | | If you are using Markdown based email rendering, you may configure your
110 | | theme and component paths here, allowing you to customize the design
111 | | of the emails. Or, you may simply stick with the Laravel defaults!
112 | |
113 | */
114 |
115 | 'markdown' => [
116 | 'theme' => 'default',
117 |
118 | 'paths' => [
119 | resource_path('views/vendor/mail'),
120 | ],
121 | ],
122 |
123 | ];
124 |
--------------------------------------------------------------------------------
/app/backend/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_DRIVER', 'sync'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Queue Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may configure the connection information for each server that
26 | | is used by your application. A default configuration has been added
27 | | for each back-end shipped with Laravel. You are free to add more.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | ],
43 |
44 | 'beanstalkd' => [
45 | 'driver' => 'beanstalkd',
46 | 'host' => 'localhost',
47 | 'queue' => 'default',
48 | 'retry_after' => 90,
49 | ],
50 |
51 | 'sqs' => [
52 | 'driver' => 'sqs',
53 | 'key' => env('SQS_KEY', 'your-public-key'),
54 | 'secret' => env('SQS_SECRET', 'your-secret-key'),
55 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
56 | 'queue' => env('SQS_QUEUE', 'your-queue-name'),
57 | 'region' => env('SQS_REGION', 'us-east-1'),
58 | ],
59 |
60 | 'redis' => [
61 | 'driver' => 'redis',
62 | 'connection' => 'default',
63 | 'queue' => 'default',
64 | 'retry_after' => 90,
65 | 'block_for' => null,
66 | ],
67 |
68 | ],
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Failed Queue Jobs
73 | |--------------------------------------------------------------------------
74 | |
75 | | These options configure the behavior of failed queue job logging so you
76 | | can control which database and table are used to store the jobs that
77 | | have failed. You may change them to any database / table you wish.
78 | |
79 | */
80 |
81 | 'failed' => [
82 | 'database' => env('DB_CONNECTION', 'mysql'),
83 | 'table' => 'failed_jobs',
84 | ],
85 |
86 | ];
87 |
--------------------------------------------------------------------------------
/app/backend/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | ],
21 |
22 | 'ses' => [
23 | 'key' => env('SES_KEY'),
24 | 'secret' => env('SES_SECRET'),
25 | 'region' => 'us-east-1',
26 | ],
27 |
28 | 'sparkpost' => [
29 | 'secret' => env('SPARKPOST_SECRET'),
30 | ],
31 |
32 | 'stripe' => [
33 | 'model' => App\User::class,
34 | 'key' => env('STRIPE_KEY'),
35 | 'secret' => env('STRIPE_SECRET'),
36 | ],
37 |
38 | ];
39 |
--------------------------------------------------------------------------------
/app/backend/config/session.php:
--------------------------------------------------------------------------------
1 | env('SESSION_DRIVER', 'file'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Session Lifetime
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may specify the number of minutes that you wish the session
27 | | to be allowed to remain idle before it expires. If you want them
28 | | to immediately expire on the browser closing, set that option.
29 | |
30 | */
31 |
32 | 'lifetime' => env('SESSION_LIFETIME', 120),
33 |
34 | 'expire_on_close' => false,
35 |
36 | /*
37 | |--------------------------------------------------------------------------
38 | | Session Encryption
39 | |--------------------------------------------------------------------------
40 | |
41 | | This option allows you to easily specify that all of your session data
42 | | should be encrypted before it is stored. All encryption will be run
43 | | automatically by Laravel and you can use the Session like normal.
44 | |
45 | */
46 |
47 | 'encrypt' => false,
48 |
49 | /*
50 | |--------------------------------------------------------------------------
51 | | Session File Location
52 | |--------------------------------------------------------------------------
53 | |
54 | | When using the native session driver, we need a location where session
55 | | files may be stored. A default has been set for you but a different
56 | | location may be specified. This is only needed for file sessions.
57 | |
58 | */
59 |
60 | 'files' => storage_path('framework/sessions'),
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Session Database Connection
65 | |--------------------------------------------------------------------------
66 | |
67 | | When using the "database" or "redis" session drivers, you may specify a
68 | | connection that should be used to manage these sessions. This should
69 | | correspond to a connection in your database configuration options.
70 | |
71 | */
72 |
73 | 'connection' => null,
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Session Database Table
78 | |--------------------------------------------------------------------------
79 | |
80 | | When using the "database" session driver, you may specify the table we
81 | | should use to manage the sessions. Of course, a sensible default is
82 | | provided for you; however, you are free to change this as needed.
83 | |
84 | */
85 |
86 | 'table' => 'sessions',
87 |
88 | /*
89 | |--------------------------------------------------------------------------
90 | | Session Cache Store
91 | |--------------------------------------------------------------------------
92 | |
93 | | When using the "apc" or "memcached" session drivers, you may specify a
94 | | cache store that should be used for these sessions. This value must
95 | | correspond with one of the application's configured cache stores.
96 | |
97 | */
98 |
99 | 'store' => null,
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Session Sweeping Lottery
104 | |--------------------------------------------------------------------------
105 | |
106 | | Some session drivers must manually sweep their storage location to get
107 | | rid of old sessions from storage. Here are the chances that it will
108 | | happen on a given request. By default, the odds are 2 out of 100.
109 | |
110 | */
111 |
112 | 'lottery' => [2, 100],
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Session Cookie Name
117 | |--------------------------------------------------------------------------
118 | |
119 | | Here you may change the name of the cookie used to identify a session
120 | | instance by ID. The name specified here will get used every time a
121 | | new session cookie is created by the framework for every driver.
122 | |
123 | */
124 |
125 | 'cookie' => env(
126 | 'SESSION_COOKIE',
127 | str_slug(env('APP_NAME', 'laravel'), '_').'_session'
128 | ),
129 |
130 | /*
131 | |--------------------------------------------------------------------------
132 | | Session Cookie Path
133 | |--------------------------------------------------------------------------
134 | |
135 | | The session cookie path determines the path for which the cookie will
136 | | be regarded as available. Typically, this will be the root path of
137 | | your application but you are free to change this when necessary.
138 | |
139 | */
140 |
141 | 'path' => '/',
142 |
143 | /*
144 | |--------------------------------------------------------------------------
145 | | Session Cookie Domain
146 | |--------------------------------------------------------------------------
147 | |
148 | | Here you may change the domain of the cookie used to identify a session
149 | | in your application. This will determine which domains the cookie is
150 | | available to in your application. A sensible default has been set.
151 | |
152 | */
153 |
154 | 'domain' => env('SESSION_DOMAIN', null),
155 |
156 | /*
157 | |--------------------------------------------------------------------------
158 | | HTTPS Only Cookies
159 | |--------------------------------------------------------------------------
160 | |
161 | | By setting this option to true, session cookies will only be sent back
162 | | to the server if the browser has a HTTPS connection. This will keep
163 | | the cookie from being sent to you if it can not be done securely.
164 | |
165 | */
166 |
167 | 'secure' => env('SESSION_SECURE_COOKIE', false),
168 |
169 | /*
170 | |--------------------------------------------------------------------------
171 | | HTTP Access Only
172 | |--------------------------------------------------------------------------
173 | |
174 | | Setting this value to true will prevent JavaScript from accessing the
175 | | value of the cookie and the cookie will only be accessible through
176 | | the HTTP protocol. You are free to modify this option if needed.
177 | |
178 | */
179 |
180 | 'http_only' => true,
181 |
182 | /*
183 | |--------------------------------------------------------------------------
184 | | Same-Site Cookies
185 | |--------------------------------------------------------------------------
186 | |
187 | | This option determines how your cookies behave when cross-site requests
188 | | take place, and can be used to mitigate CSRF attacks. By default, we
189 | | do not enable this as other CSRF protection services are in place.
190 | |
191 | | Supported: "lax", "strict"
192 | |
193 | */
194 |
195 | 'same_site' => null,
196 |
197 | ];
198 |
--------------------------------------------------------------------------------
/app/backend/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => realpath(storage_path('framework/views')),
32 |
33 | ];
34 |
--------------------------------------------------------------------------------
/app/backend/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/app/backend/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | define(App\User::class, function (Faker $faker) {
17 | return [
18 | 'name' => $faker->name,
19 | 'email' => $faker->unique()->safeEmail,
20 | 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
21 | 'remember_token' => str_random(10),
22 | ];
23 | });
24 |
--------------------------------------------------------------------------------
/app/backend/database/migrations/2018_03_07_140145_create_users_collection.php:
--------------------------------------------------------------------------------
1 | index('username');
19 | $collection->unique('email');
20 |
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | *
27 | * @return void
28 | */
29 | public function down()
30 | {
31 | //
32 | Schema::drop('users');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/backend/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call([
16 | UsersSeeder::class,
17 | // SmartStageSeeder::class
18 | ]);
19 |
20 | //$this->initTaskFields();
21 | //$this->initTaskType();
22 | }
23 |
24 | private function initTaskGroup()
25 | {
26 |
27 | }
28 |
29 | private function initTaskType()
30 | {
31 | $taskTypes = [
32 | [
33 | '_creator_uid' => '',
34 | 'title' => '任务',
35 | 'description' => '项目描述',
36 | 'icon' => 'task',
37 | 'custom_fields' => [
38 | ]
39 | ],
40 | [
41 | '_creator_uid' => '',
42 | 'title' => '需求',
43 | 'icon' => 'task',
44 | 'description' => '项目描述',
45 | 'custom_fields' => [],
46 | ],
47 | [
48 | '_creator_uid' => '',
49 | 'title' => '缺陷',
50 | 'icon' => 'task',
51 | 'description' => '项目描述',
52 | 'custom_fields' => [],
53 | ]
54 | ];
55 | foreach ($taskTypes as $type) {
56 | $taskType = new \App\Models\TaskType($type);
57 | $taskType->save();
58 | }
59 | }
60 |
61 | private function initTaskFields()
62 | {
63 | $fields = [
64 | [
65 | '_role_ids' => [],
66 | '_creator_uid' => '',
67 | '_project_id' => '',
68 |
69 | 'name' => 'note',
70 | 'title' => '备注',
71 | 'description' => '备注信息',
72 | 'type' => 'text',
73 | 'choices' => [],
74 | 'displayed' => false,
75 | 'required' => false
76 | ],
77 | [
78 | '_role_ids' => [],
79 | '_creator_uid' => '',
80 | '_project_id' => '',
81 |
82 | 'name' => 'level',
83 | 'title' => '优先级',
84 | 'description' => '优先级',
85 | 'field_type' => 'priority',
86 | 'type' => 'radio',
87 | 'choices' => [1, 2, 3, 4, 5],//5个优先级
88 | 'displayed' => false,
89 | 'required' => false
90 | ],
91 | ];
92 | foreach ($fields as $field) {
93 | $taskField = new \App\Models\TaskFields($field);
94 | $taskField->save();
95 | }
96 |
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/app/backend/database/seeds/ProjectAppsSeeder.php:
--------------------------------------------------------------------------------
1 | '需求',
17 | 'description' => '',
18 | 'type' => 1,
19 | 'sort' => 1
20 | ]);
21 | SmartTask::create([
22 | 'title' => '缺陷',
23 | 'description' => '',
24 | 'type' => 2,
25 | 'sort' => 2
26 | ]);
27 | SmartTask::create([
28 | 'title' => '迭代',
29 | 'description' => '',
30 | 'type' => 3,
31 | 'sort' => 3
32 | ]);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/backend/database/seeds/StageSeeder.php:
--------------------------------------------------------------------------------
1 | 'godtoy',
17 | 'email' => 'zhaojunlike@gmail.com',
18 | 'password' => Hash::make('zhaojun'),
19 | 'access_token' => '',
20 | 'nickname' => '',
21 | 'website' => '',
22 | 'aliens' => [],//绑定第三方
23 | 'birthday' => '',
24 | 'avatar_url' => '',
25 | 'location' => '',
26 | '_invite_uid' => '',
27 | 'status' => 1
28 | ]);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/backend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
9 | "prod": "npm run production",
10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 | },
12 | "devDependencies": {
13 | "axios": "^0.18",
14 | "bootstrap": "^4.0.0",
15 | "popper.js": "^1.12",
16 | "cross-env": "^5.1",
17 | "jquery": "^3.2",
18 | "laravel-mix": "^2.0",
19 | "lodash": "^4.17.4",
20 | "vue": "^2.5.7"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/backend/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |