fix(小程序): 下载与 CI 源目录由 mp_view 改为 mp-weixin

与 uni-app 构建产物目录名对齐,升级清空路径同步调整。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
吴昊天 2026-10-28 11:06:42 +08:00
parent 60e55bc2ac
commit c6093f571a
3 changed files with 5 additions and 5 deletions

View File

@ -833,7 +833,7 @@ class UpgradeServices extends BaseService
if (is_file($serverPackageName)) {
$clearDirs = [
app()->getRootPath() . 'public' . DS . 'admin',
app()->getRootPath() . 'public' . DS . 'statics' . DS . 'mp_view',
app()->getRootPath() . 'public' . DS . 'statics' . DS . 'mp-weixin',
app()->getRootPath() . 'public' . DS . 'statics' . DS . 'download',
];
foreach ($clearDirs as $clearDir) {

View File

@ -91,7 +91,7 @@ class RoutineTemplateController extends AuthController
//拷贝源文件
/** @var File $fileService */
$fileService = app(File::class);
$fileService->copyDir(public_path() . 'statics/mp_view', public_path() . 'statics/download');
$fileService->copyDir(public_path() . 'statics/mp-weixin', public_path() . 'statics/download');
//替换appid和名称
$this->updateConfigJson(sys_config('routine_appId'), $name !== '' ? $name : sys_config('routine_name'));
//是否开启直播

View File

@ -182,7 +182,7 @@ class RoutineCIServices extends BaseService
*
* 上传前的项目准备工作,包括复制源码和替换配置:
* 1. 清理旧的项目文件 (如果存在)
* 2. 将小程序源码从 mp_view 目录复制到 download 目录
* 2. 将小程序源码从 mp-weixin 目录复制到 download 目录
* 3. 替换 project.config.json 中的 appid 和 projectname
* 4. 根据是否开启直播决定是否移除直播插件配置
* 5. 替换代码中的 API 域名为当前服务器域名
@ -206,10 +206,10 @@ class RoutineCIServices extends BaseService
}
// 步骤2: 复制小程序源码到目标目录
// 源目录: public/statics/mp_view (小程序编译后的源码)
// 源目录: public/statics/mp-weixin (小程序编译后的源码)
/** @var File $fileService */
$fileService = app(File::class);
$fileService->copyDir(public_path() . 'statics/mp_view', $this->projectPath);
$fileService->copyDir(public_path() . 'statics/mp-weixin', $this->projectPath);
// 步骤3: 替换 project.config.json 中的 appid 和 项目名称
$this->updateConfigJson($this->appId, sys_config('routine_name', ''));