hookehuyr

fix(navheader): 修复 NavHeader 组件警告并更新文档

## 变更内容

### 修复 NavHeader 组件警告
- 添加 `showBack` prop 定义,解决 extraneous non-props attributes 警告
- 优化返回按钮显示逻辑,优先使用 prop 值
- 添加详细的 JSDoc 注释和使用示例

### 文档更新
- 更新 CHANGELOG.md,记录 NavHeader 修复内容
- 添加 login_status API 规范文档

**影响文件**:
- src/components/NavHeader.vue
- docs/CHANGELOG.md
- docs/api-specs/user/login_status.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
......@@ -50,6 +50,25 @@
---
## [2026-02-02] - 修复 NavHeader 警告
### 修复
- 修复 `NavHeader` 组件 extraneous non-props attributes 警告
- 添加 `showBack` prop 定义
- 优化返回按钮显示逻辑,优先使用 prop 值
- 影响文件:src/components/NavHeader.vue
---
**详细信息**
- **影响文件**: src/components/NavHeader.vue
- **技术栈**: Vue 3, Taro
- **测试状态**: ✅ 已通过 (代码逻辑验证)
- **备注**:
- 解决了在 Login 页面调用 NavHeader 时控制台报出的 Vue 警告
---
## [2026-02-02] - 修复 Apifox 响应解析
### 修复
......
# 查询登录状态
## OpenAPI Specification
```yaml
openapi: 3.0.1
info:
title: ''
version: 1.0.0
paths:
/srv/:
get:
summary: 查询登录状态
deprecated: false
description: ''
tags:
- 用户
parameters:
- name: f
in: query
description: ''
required: true
example: manulife
schema:
type: string
- name: a
in: query
description: ''
required: true
example: user
schema:
type: string
- name: t
in: query
description: ''
required: true
example: login_status
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
code:
type: integer
title: 状态
description: 0=失败,1=成功
msg:
type: string
title: 错误信息
data:
type: object
properties:
is_login:
type: boolean
title: 是否已经登录
description: true=登录,false=未登录
is_openid:
type: boolean
title: 是否已授权
description: true=已授权,false=未授权
x-apifox-orders:
- is_openid
- is_login
required:
- is_login
- is_openid
x-apifox-orders:
- code
- msg
- data
required:
- code
- msg
- data
headers: {}
x-apifox-name: 成功
x-apifox-ordering: 0
security: []
x-apifox-folder: 用户
x-apifox-status: testing
x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-414166128-run
components:
schemas: {}
responses: {}
securitySchemes: {}
servers: []
security: []
```
<!--
* @Date: 2026-01-29 21:09:28
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-30 20:18:20
* @LastEditTime: 2026-02-02 18:25:30
* @FilePath: /manulife-weapp/src/components/NavHeader.vue
* @Description: 通用导航头组件,用于页面顶部固定导航栏,展示页面标题。
* @Usage:
* <NavHeader title="首页" />
* <NavHeader title="详情" :show-back="true" />
-->
<template>
<!-- Placeholder to prevent content from being hidden behind fixed header -->
......@@ -24,20 +27,39 @@ import { ref, onMounted } from 'vue'
import Taro from '@tarojs/taro'
import IconFont from '@/components/IconFont.vue'
defineProps({
/**
* Props definition
* @property {String} title - Page title
* @property {Boolean} [showBack] - Whether to show back button. If undefined, auto-detects based on page stack.
*/
const props = defineProps({
title: {
type: String,
required: true
},
showBack: {
type: Boolean,
default: undefined
}
})
const canGoBack = ref(false)
/**
* Initialize back button state
*/
onMounted(() => {
const pages = Taro.getCurrentPages()
canGoBack.value = pages.length > 1
if (props.showBack !== undefined) {
canGoBack.value = props.showBack
} else {
const pages = Taro.getCurrentPages()
canGoBack.value = pages.length > 1
}
})
/**
* Handle back navigation
*/
const goBack = () => {
Taro.navigateBack()
}
......