wesmiler 1 year ago
parent
commit
6a5bae447f
9 changed files with 20743 additions and 0 deletions
  1. 53 0
      artisan
  2. 79 0
      composer.json
  3. 10571 0
      composer.lock
  4. 9906 0
      package-lock.json
  5. 19 0
      package.json
  6. 31 0
      phpunit.xml
  7. 21 0
      server.php
  8. 17 0
      webpack.mix.js
  9. 46 0
      使用开发说明.md

+ 53 - 0
artisan

@@ -0,0 +1,53 @@
+#!/usr/bin/env php
+<?php
+
+define('LARAVEL_START', microtime(true));
+
+/*
+|--------------------------------------------------------------------------
+| Register The Auto Loader
+|--------------------------------------------------------------------------
+|
+| Composer provides a convenient, automatically generated class loader
+| for our application. We just need to utilize it! We'll require it
+| into the script here so that we do not have to worry about the
+| loading of any our classes "manually". Feels great to relax.
+|
+*/
+
+require __DIR__.'/vendor/autoload.php';
+
+$app = require_once __DIR__.'/bootstrap/app.php';
+
+/*
+|--------------------------------------------------------------------------
+| Run The Artisan Application
+|--------------------------------------------------------------------------
+|
+| When we run the console application, the current CLI command will be
+| executed in this console and the response sent back to a terminal
+| or another output device for the developers. Here goes nothing!
+|
+*/
+
+$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
+
+$status = $kernel->handle(
+    $input = new Symfony\Component\Console\Input\ArgvInput,
+    new Symfony\Component\Console\Output\ConsoleOutput
+);
+
+/*
+|--------------------------------------------------------------------------
+| Shutdown The Application
+|--------------------------------------------------------------------------
+|
+| Once Artisan has finished running, we will fire off the shutdown events
+| so that any final work may be done by the application before we shut
+| down the process. This is the last thing to happen to the request.
+|
+*/
+
+$kernel->terminate($input, $status);
+
+exit($status);

+ 79 - 0
composer.json

@@ -0,0 +1,79 @@
+{
+    "name": "laravel/laravel",
+    "type": "project",
+    "description": "The Laravel Framework.",
+    "keywords": [
+        "framework",
+        "laravel"
+    ],
+    "license": "MIT",
+    "require": {
+        "php": "^8.0",
+        "ext-json": "*",
+        "alibabacloud/dysmsapi-20170525": "2.0.24",
+        "cboden/ratchet": "^0.4.4",
+        "fideloper/proxy": "^4.4",
+        "fruitcake/laravel-cors": "^2.0",
+        "getuilaboratory/getui-pushapi-php-client-v2": "dev-master",
+        "gregwar/captcha": "^1.1",
+        "guzzlehttp/guzzle": "^7.0.1",
+        "jaeger/querylist": "^4.2",
+        "laravel/framework": "^8.12",
+        "laravel/socialite": "^5.6",
+        "laravel/tinker": "^2.5",
+        "maatwebsite/excel": "^3.1",
+        "socialiteproviders/weixin": "^4.1",
+        "socialiteproviders/weixin-web": "*",
+        "wechatpay/wechatpay-guzzle-middleware": "^0.2.2",
+        "yansongda/pay": "~3.4.0"
+    },
+    "require-dev": {
+        "facade/ignition": "^2.5.2",
+        "fakerphp/faker": "^1.9.1",
+        "mockery/mockery": "^1.4.2",
+        "nunomaduro/collision": "^5.0",
+        "phpunit/phpunit": "^9.3.3"
+    },
+    "config": {
+        "optimize-autoloader": true,
+        "preferred-install": "dist",
+        "sort-packages": true
+    },
+    "extra": {
+        "laravel": {
+            "dont-discover": []
+        }
+    },
+    "autoload": {
+        "psr-4": {
+            "App\\": "app/",
+            "Database\\Factories\\": "database/factories/",
+            "Database\\Seeders\\": "database/seeders/"
+        },
+        "files": [
+            "app/Helpers/common.php",
+            "app/Helpers/function.php",
+            "app/Helpers/constants.php",
+            "app/Lib/phpqrcode/QRcode.php"
+        ]
+    },
+    "autoload-dev": {
+        "psr-4": {
+            "Tests\\": "tests/"
+        }
+    },
+    "minimum-stability": "dev",
+    "prefer-stable": true,
+    "scripts": {
+        "post-autoload-dump": [
+            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
+            "@php artisan package:discover --ansi"
+        ],
+        "post-root-package-install": [
+            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
+        ],
+        "post-create-project-cmd": [
+            "@php artisan key:generate --ansi"
+        ]
+    }
+}

File diff suppressed because it is too large
+ 10571 - 0
composer.lock


File diff suppressed because it is too large
+ 9906 - 0
package-lock.json


+ 19 - 0
package.json

@@ -0,0 +1,19 @@
+{
+    "private": true,
+    "scripts": {
+        "dev": "npm run development",
+        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
+        "watch": "npm run development -- --watch",
+        "watch-poll": "npm run watch -- --watch-poll",
+        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
+        "prod": "npm run production",
+        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js"
+    },
+    "devDependencies": {
+        "axios": "^0.19",
+        "cross-env": "^7.0",
+        "laravel-mix": "^5.0.1",
+        "lodash": "^4.17.19",
+        "resolve-url-loader": "^3.1.0"
+    }
+}

+ 31 - 0
phpunit.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
+         bootstrap="vendor/autoload.php"
+         colors="true"
+>
+    <testsuites>
+        <testsuite name="Unit">
+            <directory suffix="Test.php">./tests/Unit</directory>
+        </testsuite>
+        <testsuite name="Feature">
+            <directory suffix="Test.php">./tests/Feature</directory>
+        </testsuite>
+    </testsuites>
+    <coverage processUncoveredFiles="true">
+        <include>
+            <directory suffix=".php">./app</directory>
+        </include>
+    </coverage>
+    <php>
+        <server name="APP_ENV" value="testing"/>
+        <server name="BCRYPT_ROUNDS" value="4"/>
+        <server name="CACHE_DRIVER" value="array"/>
+        <!-- <server name="DB_CONNECTION" value="sqlite"/> -->
+        <!-- <server name="DB_DATABASE" value=":memory:"/> -->
+        <server name="MAIL_MAILER" value="array"/>
+        <server name="QUEUE_CONNECTION" value="sync"/>
+        <server name="SESSION_DRIVER" value="array"/>
+        <server name="TELESCOPE_ENABLED" value="false"/>
+    </php>
+</phpunit>

+ 21 - 0
server.php

@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Laravel - A PHP Framework For Web Artisans
+ *
+ * @package  Laravel
+ * @author   Taylor Otwell <taylor@laravel.com>
+ */
+
+$uri = urldecode(
+    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
+);
+
+// This file allows us to emulate Apache's "mod_rewrite" functionality from the
+// built-in PHP web server. This provides a convenient way to test a Laravel
+// application without having installed a "real" web server software here.
+if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
+    return false;
+}
+
+require_once __DIR__.'/public/index.php';

+ 17 - 0
webpack.mix.js

@@ -0,0 +1,17 @@
+const mix = require('laravel-mix');
+
+/*
+ |--------------------------------------------------------------------------
+ | Mix Asset Management
+ |--------------------------------------------------------------------------
+ |
+ | Mix provides a clean, fluent API for defining some Webpack build steps
+ | for your Laravel applications. By default, we are compiling the CSS
+ | file for the application as well as bundling up all the JS files.
+ |
+ */
+
+mix.js('resources/js/app.js', 'public/js')
+    .postCss('resources/css/app.css', 'public/css', [
+        //
+    ]);

+ 46 - 0
使用开发说明.md

@@ -0,0 +1,46 @@
+#### 《框架使用开发说明》
+1、安装和环境要求
+
+    1.环境要求:php7.3+(若有支付功能建议php8.0)、nginx、redis、mysql8.0(建议)
+    2.php扩展要求:fileinfo、opcache、redis、imagemagick、Swoole4(有即时通讯或者长连接服务时)
+    3.安装:
+        1)解压代码到服务器根目录
+        2)创建数据库,并导入根目录下数据库文件
+        3)修改根目录下的.env配置文件,把数据库,redis缓存、域名地址相关的都修改掉
+        4)添加nginx的laravel8伪静态:
+        location / {  
+            # 请求地址允许跨域
+            add_header Access-Control-Allow-Origin *;
+            # 请求方法允许跨域
+            add_header Access-Control-Allow-Methods 'GET,POST,OPTIONS,PUT,DELETE,PATCH,Origin';
+            # 设置是否允许 cookie 传输
+            add_header Access-Control-Allow-Credentials 'true';
+            # 设置请求头 这里为什么不设置通配符 * 因为不支持
+            add_header Access-Control-Allow-Headers 'Authorization,Sign,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,X-Data-Type,X-Requested-With,X-Data-Type,X-Auth-Token';
+            
+            if ($request_method = 'OPTIONS') {
+                        return 200;
+              }
+              
+            try_files $uri $uri/ /index.php$is_args$query_string;  
+        }  
+
+2、开发使用:
+1.后台运行命令:
+1)环境要求node14.0,其他按照npm更新情况更新依赖包即可
+2)首次运行检查有无node_modules依赖目录,没有则执行npm install 或npm update安装更新依赖
+3)修改admin/src/connfig/setting.js内的接口域名配置
+3)npm run dev 运行
+4)npm run build 打包
+5)打包好的文件在admin/dist目录,发布则将该目录整个内容复制到项目根目录public/rrcadm下即可
+6)后台直接访问域名/rrcadm
+
+
+2.后台开发:
+1)先创建菜单模块,路由等规则参考系统管理或用户管理,创建菜单节点路由
+2)routes/web.php内新建对应后台模块接口路由,路由接口规则参考现有的即可
+3)addons/admin/src/views视图目录下创建对应vue模板文件,可分模块,即类似member就是用户管理模块,下面的文件就是子菜单
+4)其余板块设计可以类似views/system目录下的模块参考
+5)富文本编辑器在views/system/notice内有使用可以直接参考
+
+