peixue-dev/Archive/[一次性]清除缓存重新编译-游客模式三个页面修复-2026-02-01.bat

65 lines
1.7 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 >nul
echo ========================================
echo 清除缓存并重新编译小程序
echo 修复:游客模式三个页面(兴趣培养、专项突破、测评师)
echo ========================================
echo.
cd /d "%~dp0..\peidu\uniapp"
echo [1/4] 清除 node_modules/.cache 缓存...
if exist "node_modules\.cache" (
rmdir /s /q "node_modules\.cache"
echo ✓ 已清除 node_modules/.cache
) else (
echo - node_modules/.cache 不存在
)
echo.
echo [2/4] 清除 unpackage 编译产物...
if exist "unpackage" (
rmdir /s /q "unpackage"
echo ✓ 已清除 unpackage
) else (
echo - unpackage 不存在
)
echo.
echo [3/4] 清除 dist 目录...
if exist "dist" (
rmdir /s /q "dist"
echo ✓ 已清除 dist
) else (
echo - dist 不存在
)
echo.
echo [4/4] 重新编译小程序(微信小程序)...
call npm run dev:mp-weixin
echo.
echo ========================================
echo 编译完成!
echo.
echo 修复内容:
echo 1. request.js - 添加游客白名单接口
echo - /api/interest-course/list
echo - /api/interest-course/detail
echo - /api/assessment/list
echo - /api/assessment/detail
echo.
echo 2. 三个页面添加 error.silent 检查
echo - service-package/pages/special/list.vue
echo - service-package/pages/interest/list.vue
echo - service-package/pages/assessment/list.vue
echo.
echo 测试步骤:
echo 1. 退出登录(进入游客模式)
echo 2. 点击首页的"兴趣培养"按钮
echo 3. 点击首页的"专项突破"按钮
echo 4. 点击首页的"测评师"按钮
echo 5. 确认三个页面都能正常显示不会弹出401错误
echo ========================================
pause