feat(fsgx): 管理后台与部署相关更新

- admin: 路由守卫修复空白页、addRoute、devServer 端口与代理
- admin: package.json 生产构建去掉 NODE_OPTIONS openssl
- ajcaptcha: 滑块验证码改用 file 缓存避免 Redis NOAUTH
- nginx-crmeb: 增加 81 端口站点
- docs: deploy 补充 NOAUTH/Redis 说明,新增 H5 部署脚本与 nginx 示例
- 其他: database、start-api、swoole ini、uniapp 资源等

Made-with: Cursor
This commit is contained in:
apple
2026-03-21 02:33:14 +08:00
parent 413eb19adf
commit ae8b866319
20 changed files with 697 additions and 45 deletions

View File

@@ -322,7 +322,7 @@ php think swoole
5. 后台登录:
http://域名/admin
默认账号admin 密码A@123456
默认账号admin 密码A@123456 或 A123456
## 启动命令

View File

@@ -24,6 +24,10 @@ class InstallMiddleware implements MiddlewareInterface
public function handle(Request $request, \Closure $next)
{
// CORS 预检请求不重定向,交给后续 AllowOriginMiddleware 返回 200 + CORS 头
if (strtoupper($request->method()) === 'OPTIONS') {
return $next($request);
}
//检测是否已安装CRMEB系统
if (!is_dir(root_path() . "public/install/") || !is_file(root_path() . "public/install/install.lock")) {
return redirect('/install/index');

View File

@@ -35,8 +35,10 @@ return [
'text' => ''
],
'cache' => [
//若您使用了框架并且想使用类似于redis这样的缓存驱动则应换成框架的中的缓存驱动
'constructor' => app()->make(\think\Cache::class),
// file 存储:生产环境 Redis 密码错误时避免 ajcaptcha 报 NOAUTH业务主缓存仍用 config/cache.php
'constructor' => static function ($options) {
return app()->make(\think\Cache::class)->store('file');
},
'method' => [
//遵守PSR-16规范不需要设置此项tp6, laravel,hyperf。如tp5就不支持tp5缓存方法是rm,所以要配置为"delete" => "rm"
/**

View File

@@ -29,8 +29,8 @@ return [
'type' => env('DATABASE_TYPE', 'mysql'),
// 服务器地址
'hostname' => env('DATABASE_HOSTNAME', '127.0.0.1'),
// 数据库名
'database' => env('DATABASE_DATABASE', ''),
// 数据库名(直接写死,避免 .env 路径问题)
'database' => 'fsgx-shop',
// 用户名
'username' => env('DATABASE_USERNAME', 'root'),
// 密码

View File

@@ -4,4 +4,6 @@
set -e
cd "$(dirname "$0")/.."
php -d memory_limit=300M think swoole
# 使用 PHP 8.0Swoole Loader 仅支持 8.0
PHP_BIN="${PHP_BIN:-/usr/local/opt/php@8.0/bin/php}"
"$PHP_BIN" -d memory_limit=300M think swoole

View File

@@ -0,0 +1,6 @@
; 供 PHP 8.0 加载 Swoole Loader在 conf.d 中软链或复制此文件,或 php.ini 中 include 此路径)
; 使用方式(任选其一):
; 1. 复制到 PHP 8.0 conf.dcp help/swoole-loader-php80.ini /usr/local/etc/php/8.0/conf.d/99-swoole-loader.ini
; 并确保 extension= 指向的 .so 路径存在(如下方为项目内绝对路径,需按本机修改)。
; 2. 或将 .so 复制到 PHP 8.0 的 extension_dir 后改为extension = swoole_loader_80_nts.so
extension = /Users/apple/scott2026/huangjingfen/pro_v3.5.1/help/swoole_loader_mac/swoole_loader_80_nts.so

View File

@@ -1,3 +1,4 @@
# 站点1默认 80 端口
server {
listen 80;
server_name 127.0.0.1;
@@ -31,3 +32,38 @@ server {
expires 12h;
}
}
# 站点281 端口(远程 MySQL: fsgx-shop
server {
listen 81;
server_name 127.0.0.1;
root /Users/apple/scott2026/huangjingfen/pro_v3.5.1/public;
index index.html index.php;
location ~* \.(php|jsp|cgi|asp|aspx)$ {
proxy_pass http://127.0.0.1:20199;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
}
location / {
if (!-e $request_filename) {
proxy_pass http://127.0.0.1:20199;
}
proxy_http_version 1.1;
proxy_read_timeout 360s;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
add_header Cache-Control no-cache;
expires 12h;
}
}

View File

@@ -16,8 +16,9 @@ define('DS', DIRECTORY_SEPARATOR);
require __DIR__ . '/../vendor/autoload.php';
// 执行HTTP应用并响应
$http = (new App())->http;
// 显式指定应用根目录,确保 .env 正确加载(避免 getDefaultRootPath 返回上级目录)
$rootPath = dirname(__DIR__) . DIRECTORY_SEPARATOR;
$http = (new App($rootPath))->http;
$response = $http->run();

View File

@@ -15,5 +15,6 @@ namespace think;
// 加载基础文件
require __DIR__ . '/vendor/autoload.php';
// 应用初始化
(new App())->console->run();
// 显式指定应用根目录,确保 .env 正确加载(避免 getDefaultRootPath 返回上级目录)
$rootPath = __DIR__ . DIRECTORY_SEPARATOR;
(new App($rootPath))->console->run();

View File

@@ -5,6 +5,6 @@ VUE_APP_ENV='production'
# 页面 title
VUE_APP_TITLE=CRMEB
# socket 系统连接地址 (ws)或(wss)://www.crmeb.com(换成你的域名)/ws 非独立部署默认为空
VUE_APP_WS_ADMIN_URL='ws://hjf.suzhouyuqi.com/ws'
VUE_APP_WS_ADMIN_URL='ws://fsgx.uj345.com/ws'
# 接口请求地址 (http)或 (https)://www.crmeb.com(换成你的域名)/adminapi 非独立部署默认为空
VUE_APP_API_URL='http://hjf.suzhouyuqi.com/adminapi'
VUE_APP_API_URL='http://fsgx.uj345.com/adminapi'

View File

@@ -5,7 +5,7 @@
"scripts": {
"serve": "node src/libs/start.js && vue-cli-service serve --open --mode=dev",
"dev": "node src/libs/start.js && vue-cli-service serve --open --mode=dev",
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build --mode=production"
"build": "vue-cli-service build --mode=production"
},
"dependencies": {
"@babel/polyfill": "^7.12.1",

View File

@@ -79,7 +79,7 @@ const router = new VueRouter({
routes: [...routes],
mode: Setting.routerMode,
});
router.addRoutes(supplierRoutes);
supplierRoutes.forEach((route) => router.addRoute(route));
setTimeout(() => {
console.log(router, "11");
}, 1000);
@@ -140,6 +140,8 @@ function handlePublicRoute(to, next) {
if (hasMenus || isLoginPage) {
return next();
}
// 无菜单且非登录页时,重定向到登录页(修复空白页:此前未调用 next() 导致导航挂起)
next({ path: `${Setting.roterPre}/login`, query: { redirect: to.fullPath } });
}
router.afterEach((to) => {
// if (Setting.showProgressBar) iView.LoadingBar.finish();

View File

@@ -27,11 +27,11 @@ module.exports = {
productionSourceMap: false, //关闭生产环境下的SourceMap映射文件
devServer: {
publicPath: Setting.publicPath,
port: 8080,
port: 8085,
proxy: {
'/adminapi': { target: 'http://127.0.0.1:20199', changeOrigin: true },
'/api': { target: 'http://127.0.0.1:20199', changeOrigin: true },
'/kefuapi': { target: 'http://127.0.0.1:20199', changeOrigin: true },
'/adminapi': { target: process.env.VUE_APP_API_URL ? new URL(process.env.VUE_APP_API_URL).origin : 'http://127.0.0.1:20199', changeOrigin: true },
'/api': { target: process.env.VUE_APP_API_URL ? new URL(process.env.VUE_APP_API_URL).origin : 'http://127.0.0.1:20199', changeOrigin: true },
'/kefuapi': { target: process.env.VUE_APP_API_URL ? new URL(process.env.VUE_APP_API_URL).origin : 'http://127.0.0.1:20199', changeOrigin: true },
},
},

View File

@@ -1,7 +1,7 @@
{
"name" : "crmeb",
"appid" : "__UNI__70A74E1",
"description" : "crmeb商城",
"name" : "黄精粉",
"appid" : "__UNI__6691FE3",
"description" : "黄精粉商城",
"versionName" : "3.5.1",
"versionCode" : 351,
"transformPx" : false,
@@ -125,13 +125,13 @@
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
"hdpi" : "",
"xhdpi" : "",
"xxhdpi" : "",
"xxxhdpi" : ""
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"appstore" : "",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
@@ -144,14 +144,14 @@
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"app@2x" : "",
"app@3x" : "",
"notification@2x" : "",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
"settings@2x" : "",
"settings@3x" : "",
"spotlight@2x" : "",
"spotlight@3x" : ""
}
}
}
@@ -214,11 +214,11 @@
},
"h5" : {
"devServer" : {
"https" : false
"https" : true
},
"router" : {
"mode" : "history",
"base" : "/h5/"
"base" : "/"
},
"domain" : "",
"sdkConfigs" : {
@@ -251,7 +251,8 @@
"statusbar" : {
"immersed" : true
}
}
},
"fallbackLocale" : "zh-Hans"
}
/* "lazyCodeLoading" : "requiredComponents", */// "optimization" : {
// "subPackages" : true

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB