128 lines
3.7 KiB
Markdown
128 lines
3.7 KiB
Markdown
|
|
# Phase 1 检查点报告 — 17:30 自动检查
|
|||
|
|
|
|||
|
|
> 生成时间:2026-03-30 17:30
|
|||
|
|
> 检查范围:`backend-adminend/src`
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 检查结果汇总
|
|||
|
|
|
|||
|
|
| # | 检查项 | 状态 | 说明 |
|
|||
|
|
|---|--------|------|------|
|
|||
|
|
| 1 | `EmptyLayout.vue` 空白布局 | ❌ **未找到** | `src/layout/` 目录下只有 `index.vue`,未创建 EmptyLayout |
|
|||
|
|
| 2 | `requestNoAuth.js` 免认证请求实例 | ❌ **未找到** | `src/utils/` 目录下只有 `request.js`,未创建 requestNoAuth |
|
|||
|
|
| 3 | 路由模块 `integralExternal.js` | ❌ **未找到** | `src/router/modules/` 下无此文件,constantRoutes 未注册 |
|
|||
|
|
| 4 | `permission.js` 白名单前缀匹配 | ❌ **未修改** | 当前仍为精确匹配:`whiteList.indexOf(to.path) !== -1`,未改为前缀匹配 |
|
|||
|
|
| 5 | API 文件 `integralExternal.js` | ❌ **未找到** | `src/api/` 目录下无此文件 |
|
|||
|
|
| 6 | 冒烟验证(无 token 访问不跳转登录) | ⚠️ **无法验证** | 基础设施文件均未创建,无法执行冒烟测试 |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 当前实际状态
|
|||
|
|
|
|||
|
|
**Phase 1 全部 5 项任务均未完成。**
|
|||
|
|
|
|||
|
|
当前 `permission.js` 白名单内容:
|
|||
|
|
```js
|
|||
|
|
const whiteList = ['/login', '/auth-redirect'];
|
|||
|
|
// 匹配方式:whiteList.indexOf(to.path) !== -1(精确匹配)
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
访问 `/integral-external/order` 无 token 时,**会被重定向到登录页**。
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 建议行动
|
|||
|
|
|
|||
|
|
### 立即按顺序创建以下文件:
|
|||
|
|
|
|||
|
|
**步骤 1:创建 `src/layout/EmptyLayout.vue`**
|
|||
|
|
```vue
|
|||
|
|
<template>
|
|||
|
|
<div class="empty-layout">
|
|||
|
|
<router-view />
|
|||
|
|
</div>
|
|||
|
|
</template>
|
|||
|
|
|
|||
|
|
<script>
|
|||
|
|
export default {
|
|||
|
|
name: 'EmptyLayout'
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 2:创建 `src/utils/requestNoAuth.js`**
|
|||
|
|
```js
|
|||
|
|
import axios from 'axios'
|
|||
|
|
|
|||
|
|
const requestNoAuth = axios.create({
|
|||
|
|
baseURL: process.env.VUE_APP_BASE_API,
|
|||
|
|
timeout: 15000
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
requestNoAuth.interceptors.response.use(
|
|||
|
|
response => response.data,
|
|||
|
|
error => Promise.reject(error)
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
export default requestNoAuth
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 3:创建 `src/router/modules/integralExternal.js`**
|
|||
|
|
```js
|
|||
|
|
import EmptyLayout from '@/layout/EmptyLayout'
|
|||
|
|
|
|||
|
|
const integralExternalRouter = {
|
|||
|
|
path: '/integral-external',
|
|||
|
|
component: EmptyLayout,
|
|||
|
|
children: [
|
|||
|
|
{ path: 'order', name: 'IntegralOrder', component: () => import('@/views/integral/external/order/index') },
|
|||
|
|
{ path: 'user', name: 'IntegralUser', component: () => import('@/views/integral/external/user/index') },
|
|||
|
|
{ path: 'detail', name: 'IntegralDetail', component: () => import('@/views/integral/external/detail/index') }
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export default integralExternalRouter
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 4:修改 `src/permission.js` 白名单为前缀匹配**
|
|||
|
|
```js
|
|||
|
|
// 改为:
|
|||
|
|
const whiteList = ['/login', '/auth-redirect', '/integral-external'];
|
|||
|
|
|
|||
|
|
// 修改匹配逻辑(约第 55 行):
|
|||
|
|
if (whiteList.some(path => to.path.startsWith(path))) {
|
|||
|
|
next();
|
|||
|
|
} else {
|
|||
|
|
next(`/login?redirect=${to.path}`);
|
|||
|
|
NProgress.done();
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 5:创建 `src/api/integralExternal.js`**(基础框架)
|
|||
|
|
```js
|
|||
|
|
import requestNoAuth from '@/utils/requestNoAuth'
|
|||
|
|
|
|||
|
|
export function getIntegralOrderList(params) {
|
|||
|
|
return requestNoAuth({ url: '/api/integral/order/list', method: 'get', params })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export function getIntegralUserList(params) {
|
|||
|
|
return requestNoAuth({ url: '/api/integral/user/list', method: 'get', params })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export function getIntegralDetail(params) {
|
|||
|
|
return requestNoAuth({ url: '/api/integral/detail/list', method: 'get', params })
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## ⚠️ 重要提示
|
|||
|
|
|
|||
|
|
**免登录链路是后续 Phase 2~4 一切工作的前提**,如果 permission.js 白名单不通,所有积分外部页面都无法访问。
|
|||
|
|
|
|||
|
|
请优先确保 `permission.js` 的前缀匹配逻辑正确生效后,再进入 Phase 2 开发。
|
|||
|
|
|
|||
|
|
当前时间已到 17:30,**建议立即开始 Phase 1 任务**,完成后方可进入 Phase 2:积分订单页面开发。
|