hookehuyr

feat(api): 支持 t 参数并重构 API 生成流程

- 修改 generateApiFromOpenAPI.js 支持 t 参数(接口功能)
- t 参数与 a 参数(文件夹)共同构成 URL 路径
- 在 JSDoc 中过滤 a、f、t 参数,避免重复传递
- 重构 OpenAPI 文档结构,按模块组织(user/wechat/feedback/news)
- 重新生成所有 API 文件,包含正确的 URL 结构

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 +# 意见反馈列表
2 +
3 +## OpenAPI Specification
4 +
5 +```yaml
6 +openapi: 3.0.1
7 +info:
8 + title: ''
9 + version: 1.0.0
10 +paths:
11 + /srv/:
12 + get:
13 + summary: 意见反馈列表
14 + deprecated: false
15 + description: ''
16 + tags:
17 + - 意见反馈
18 + parameters:
19 + - name: f
20 + in: query
21 + description: ''
22 + required: true
23 + example: manulife
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: true
30 + example: feedback
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: list
38 + schema:
39 + type: string
40 + - name: page
41 + in: query
42 + description: 页码,从0开始
43 + required: true
44 + example: '0'
45 + schema:
46 + type: string
47 + - name: limit
48 + in: query
49 + description: 每页数量
50 + required: true
51 + example: '10'
52 + schema:
53 + type: string
54 + responses:
55 + '200':
56 + description: ''
57 + content:
58 + application/json:
59 + schema:
60 + type: object
61 + properties:
62 + code:
63 + type: integer
64 + msg:
65 + type: string
66 + data:
67 + type: object
68 + properties:
69 + list:
70 + type: array
71 + items:
72 + type: object
73 + properties:
74 + id:
75 + type: integer
76 + title: 订单ID
77 + status:
78 + type: integer
79 + title: 状态
80 + description: 3=待处理, 5=已处理
81 + category:
82 + type: string
83 + title: 反馈类别
84 + description: 1=功能建议, 3=界面设计, 5=车辆新鲜, 7=其他问题
85 + images:
86 + type: string
87 + title: 图片
88 + contact:
89 + type: string
90 + title: 联系方式
91 + note:
92 + type: string
93 + title: 反馈内容
94 + reply:
95 + type: string
96 + title: 回复
97 + reply_time:
98 + type: string
99 + title: 回复时间
100 + x-apifox-orders:
101 + - id
102 + - status
103 + - category
104 + - images
105 + - contact
106 + - note
107 + - reply
108 + - reply_time
109 + required:
110 + - reply
111 + required:
112 + - list
113 + x-apifox-orders:
114 + - list
115 + required:
116 + - code
117 + - msg
118 + - data
119 + x-apifox-orders:
120 + - code
121 + - msg
122 + - data
123 + headers: {}
124 + x-apifox-name: 成功
125 + x-apifox-ordering: 0
126 + security: []
127 + x-apifox-folder: 意见反馈
128 + x-apifox-status: released
129 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-413906670-run
130 +components:
131 + schemas: {}
132 + responses: {}
133 + securitySchemes: {}
134 +servers: []
135 +security: []
136 +
137 +```
1 +# 提交意见反馈
2 +
3 +## OpenAPI Specification
4 +
5 +```yaml
6 +openapi: 3.0.1
7 +info:
8 + title: ''
9 + version: 1.0.0
10 +paths:
11 + /srv/:
12 + post:
13 + summary: 提交意见反馈
14 + deprecated: false
15 + description: ''
16 + tags:
17 + - 意见反馈
18 + parameters:
19 + - name: f
20 + in: query
21 + description: ''
22 + required: true
23 + example: jiangedianlv
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: true
30 + example: common
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: submit_feedback
38 + schema:
39 + type: string
40 + requestBody:
41 + content:
42 + application/x-www-form-urlencoded:
43 + schema:
44 + type: object
45 + properties:
46 + f:
47 + example: manulife
48 + type: string
49 + a:
50 + example: feedback
51 + type: string
52 + t:
53 + example: add
54 + type: string
55 + category:
56 + description: 反馈类别。1=功能建议, 3=界面设计, 5=车辆新鲜, 7=其他问题
57 + example: '1'
58 + type: string
59 + note:
60 + description: 反馈内容
61 + example: '3'
62 + type: string
63 + contact:
64 + description: 用户留下的联系方式
65 + example: '3'
66 + type: string
67 + images:
68 + description: 图片
69 + type: string
70 + required:
71 + - f
72 + - a
73 + - t
74 + - category
75 + - note
76 + - contact
77 + - images
78 + examples: {}
79 + responses:
80 + '200':
81 + description: ''
82 + content:
83 + application/json:
84 + schema:
85 + type: object
86 + properties:
87 + code:
88 + type: integer
89 + msg:
90 + type: string
91 + required:
92 + - code
93 + - msg
94 + x-apifox-orders:
95 + - code
96 + - msg
97 + headers: {}
98 + x-apifox-name: 成功
99 + x-apifox-ordering: 0
100 + security: []
101 + x-apifox-folder: 意见反馈
102 + x-apifox-status: released
103 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-413906671-run
104 +components:
105 + schemas: {}
106 + responses: {}
107 + securitySchemes: {}
108 +servers: []
109 +security: []
110 +
111 +```
1 +# 消息详情
2 +
3 +## OpenAPI Specification
4 +
5 +```yaml
6 +openapi: 3.0.1
7 +info:
8 + title: ''
9 + version: 1.0.0
10 +paths:
11 + /:
12 + get:
13 + summary: 消息详情
14 + deprecated: false
15 + description: ''
16 + tags:
17 + - 消息
18 + parameters:
19 + - name: f
20 + in: query
21 + description: ''
22 + required: true
23 + example: manulife
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: true
30 + example: website_msg
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: detail
38 + schema:
39 + type: string
40 + - name: i
41 + in: query
42 + description: 消息ID
43 + required: true
44 + example: '817677'
45 + schema:
46 + type: string
47 + responses:
48 + '200':
49 + description: ''
50 + content:
51 + application/json:
52 + schema:
53 + type: object
54 + properties:
55 + code:
56 + type: integer
57 + msg:
58 + type: string
59 + data:
60 + type: array
61 + items:
62 + type: object
63 + properties:
64 + id:
65 + type: integer
66 + title: 消息id
67 + note:
68 + type: string
69 + title: 消息内容
70 + created_time:
71 + type: string
72 + title: 发消息的时间
73 + status:
74 + type: string
75 + title: 状态
76 + description: send=以发送未读取,read=已读取
77 + x-apifox-orders:
78 + - id
79 + - note
80 + - created_time
81 + - status
82 + required:
83 + - note
84 + - created_time
85 + - status
86 + required:
87 + - code
88 + - msg
89 + - data
90 + x-apifox-orders:
91 + - code
92 + - msg
93 + - data
94 + headers: {}
95 + x-apifox-name: 成功
96 + x-apifox-ordering: 0
97 + security: []
98 + x-apifox-folder: 消息
99 + x-apifox-status: released
100 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-413906673-run
101 +components:
102 + schemas: {}
103 + responses: {}
104 + securitySchemes: {}
105 +servers: []
106 +security: []
107 +
108 +```
1 +# 我的消息列表
2 +
3 +## OpenAPI Specification
4 +
5 +```yaml
6 +openapi: 3.0.1
7 +info:
8 + title: ''
9 + version: 1.0.0
10 +paths:
11 + /srv/:
12 + get:
13 + summary: 我的消息列表
14 + deprecated: false
15 + description: ''
16 + tags:
17 + - 消息
18 + parameters:
19 + - name: f
20 + in: query
21 + description: ''
22 + required: true
23 + example: manulife
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: true
30 + example: website_msg
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: my_list
38 + schema:
39 + type: string
40 + - name: page
41 + in: query
42 + description: ''
43 + required: true
44 + example: '0'
45 + schema:
46 + type: string
47 + - name: limit
48 + in: query
49 + description: ''
50 + required: true
51 + example: '10'
52 + schema:
53 + type: string
54 + responses:
55 + '200':
56 + description: ''
57 + content:
58 + application/json:
59 + schema:
60 + type: object
61 + properties:
62 + code:
63 + type: integer
64 + msg:
65 + type: string
66 + data:
67 + type: array
68 + items:
69 + type: object
70 + properties:
71 + id:
72 + type: integer
73 + title: 消息id
74 + note:
75 + type: string
76 + title: 消息内容
77 + created_time:
78 + type: string
79 + title: 发消息的时间
80 + status:
81 + type: string
82 + title: 状态
83 + description: send=以发送未读取,read=已读取
84 + x-apifox-orders:
85 + - id
86 + - note
87 + - created_time
88 + - status
89 + required:
90 + - note
91 + - created_time
92 + - status
93 + required:
94 + - code
95 + - msg
96 + - data
97 + x-apifox-orders:
98 + - code
99 + - msg
100 + - data
101 + headers: {}
102 + x-apifox-name: 成功
103 + x-apifox-ordering: 0
104 + security: []
105 + x-apifox-folder: 消息
106 + x-apifox-status: released
107 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-413906672-run
108 +components:
109 + schemas: {}
110 + responses: {}
111 + securitySchemes: {}
112 +servers: []
113 +security: []
114 +
115 +```
1 -# 获取订单详情
2 -
3 -## OpenAPI Specification
4 -
5 -```yaml
6 -openapi: 3.0.1
7 -info:
8 - title: ''
9 - version: 1.0.0
10 -paths:
11 - /srv/:
12 - get:
13 - summary: 获取订单详情
14 - description: 根据订单ID获取订单详细信息
15 - tags:
16 - - 订单管理
17 - parameters:
18 - - name: f
19 - in: query
20 - example: behalo
21 - - name: a
22 - in: query
23 - example: order_detail
24 - - name: id
25 - in: query
26 - description: 订单ID
27 - required: true
28 - example: 123
29 - schema:
30 - type: integer
31 - responses:
32 - '200':
33 - description: 成功返回订单详情
34 - content:
35 - application/json:
36 - schema:
37 - type: object
38 - properties:
39 - code:
40 - type: integer
41 - description: 0=失败,1=成功
42 - msg:
43 - type: string
44 - description: 错误信息
45 - data:
46 - type: object
47 - properties:
48 - order:
49 - type: object
50 - properties:
51 - id:
52 - type: integer
53 - description: 订单ID
54 - order_no:
55 - type: string
56 - description: 订单号
57 - total_amount:
58 - type: number
59 - description: 订单总金额
60 - status:
61 - type: string
62 - description: 订单状态
63 - items:
64 - type: array
65 - description: 订单商品列表
66 - items:
67 - type: object
68 - properties:
69 - product_id:
70 - type: integer
71 - description: 商品ID
72 - product_name:
73 - type: string
74 - description: 商品名称
75 - quantity:
76 - type: integer
77 - description: 购买数量
78 - price:
79 - type: number
80 - description: 商品单价
81 -```
1 -# 获取订单列表
2 -
3 -## OpenAPI Specification
4 -
5 -```yaml
6 -openapi: 3.0.1
7 -info:
8 - title: ''
9 - version: 1.0.0
10 -paths:
11 - /srv/:
12 - get:
13 - summary: 获取订单列表
14 - description: 分页获取用户的订单列表
15 - tags:
16 - - 订单管理
17 - parameters:
18 - - name: f
19 - in: query
20 - example: behalo
21 - - name: a
22 - in: query
23 - example: order_list
24 - - name: page
25 - in: query
26 - description: 页码
27 - example: 1
28 - schema:
29 - type: integer
30 - - name: pageSize
31 - in: query
32 - description: 每页数量
33 - example: 10
34 - schema:
35 - type: integer
36 - responses:
37 - '200':
38 - description: 成功返回订单列表
39 - content:
40 - application/json:
41 - schema:
42 - type: object
43 - properties:
44 - code:
45 - type: integer
46 - title: 状态码
47 - description: 0=失败,1=成功
48 - msg:
49 - type: string
50 - title: 消息
51 - data:
52 - type: object
53 - properties:
54 - list:
55 - type: array
56 - items:
57 - type: object
58 - properties:
59 - id:
60 - type: integer
61 - description: 订单ID
62 - order_no:
63 - type: string
64 - description: 订单号
65 - status:
66 - type: string
67 - description: 订单状态
68 - total_amount:
69 - type: number
70 - description: 订单金额
71 -```
1 -# 查询我的信息 1 +# 获取个人信息
2 2
3 ## OpenAPI Specification 3 ## OpenAPI Specification
4 4
...@@ -10,24 +10,31 @@ info: ...@@ -10,24 +10,31 @@ info:
10 paths: 10 paths:
11 /srv/: 11 /srv/:
12 get: 12 get:
13 - summary: 查询我的信息 13 + summary: 获取个人信息
14 deprecated: false 14 deprecated: false
15 description: '' 15 description: ''
16 tags: 16 tags:
17 - - 个人信息 17 + - 用户
18 parameters: 18 parameters:
19 - name: f 19 - name: f
20 in: query 20 in: query
21 description: '' 21 description: ''
22 - required: false 22 + required: true
23 - example: behalo 23 + example: manulife
24 schema: 24 schema:
25 type: string 25 type: string
26 - name: a 26 - name: a
27 in: query 27 in: query
28 description: '' 28 description: ''
29 - required: false 29 + required: true
30 - example: user_info 30 + example: user
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: get_profile
31 schema: 38 schema:
32 type: string 39 type: string
33 responses: 40 responses:
...@@ -40,11 +47,8 @@ paths: ...@@ -40,11 +47,8 @@ paths:
40 properties: 47 properties:
41 code: 48 code:
42 type: integer 49 type: integer
43 - title: 状态
44 - description: 0=失败,1=成功
45 msg: 50 msg:
46 type: string 51 type: string
47 - title: 错误信息
48 data: 52 data:
49 type: object 53 type: object
50 properties: 54 properties:
...@@ -53,53 +57,26 @@ paths: ...@@ -53,53 +57,26 @@ paths:
53 properties: 57 properties:
54 id: 58 id:
55 type: integer 59 type: integer
56 - description: 用户ID 60 + title: 用户ID
57 - name: 61 + avatar_url:
58 type: string 62 type: string
59 - description: 姓名 63 + title: 头像
60 - mobile: 64 + name:
61 type: string 65 type: string
62 - description: 手机号 66 + title: 姓名
63 x-apifox-orders: 67 x-apifox-orders:
64 - id 68 - id
65 - name 69 - name
66 - - mobile 70 + - avatar_url
67 - nullable: true 71 + title: 用户信息
68 - checkin:
69 - type: object
70 - properties:
71 - total_days:
72 - type: integer
73 - title: 累计打卡天数
74 - consecutive_days:
75 - type: integer
76 - title: 连续打卡天数
77 - longest_consecutive_days:
78 - type: integer
79 - title: 最长连续打卡天数
80 - x-apifox-orders:
81 - - total_days
82 - - consecutive_days
83 - - longest_consecutive_days
84 required: 72 required:
85 - - total_days 73 + - id
86 - - longest_consecutive_days 74 + - avatar_url
87 - - consecutive_days 75 + - name
88 - unread_msg_count:
89 - type: integer
90 - title: 未读的消息数量
91 - is_teacher:
92 - type: boolean
93 - title: 是不是老师
94 x-apifox-orders: 76 x-apifox-orders:
95 - user 77 - user
96 - - checkin
97 - - unread_msg_count
98 - - is_teacher
99 required: 78 required:
100 - - checkin 79 + - user
101 - - unread_msg_count
102 - - is_teacher
103 x-apifox-orders: 80 x-apifox-orders:
104 - code 81 - code
105 - msg 82 - msg
...@@ -112,16 +89,14 @@ paths: ...@@ -112,16 +89,14 @@ paths:
112 x-apifox-name: 成功 89 x-apifox-name: 成功
113 x-apifox-ordering: 0 90 x-apifox-ordering: 0
114 security: [] 91 security: []
115 - x-apifox-folder: 个人信息 92 + x-apifox-folder: 用户
116 - x-apifox-status: tested 93 + x-apifox-status: released
117 - x-run-in-apifox: https://app.apifox.com/web/project/6084040/apis/api-275317513-run 94 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-413906668-run
118 components: 95 components:
119 schemas: {} 96 schemas: {}
120 responses: {} 97 responses: {}
121 securitySchemes: {} 98 securitySchemes: {}
122 -servers: 99 +servers: []
123 - - url: https://oa-dev.onwall.cn
124 - description: 测试环境
125 security: [] 100 security: []
126 101
127 ``` 102 ```
......
1 -# 修改我的信息 1 +# 登录并绑定openid
2 2
3 ## OpenAPI Specification 3 ## OpenAPI Specification
4 4
...@@ -10,24 +10,31 @@ info: ...@@ -10,24 +10,31 @@ info:
10 paths: 10 paths:
11 /srv/: 11 /srv/:
12 post: 12 post:
13 - summary: 修改我的信息 13 + summary: 登录并绑定openid
14 deprecated: false 14 deprecated: false
15 description: '' 15 description: ''
16 tags: 16 tags:
17 - - 个人信息 17 + - 用户
18 parameters: 18 parameters:
19 - - name: user-id 19 + - name: f
20 - in: header 20 + in: query
21 description: '' 21 description: ''
22 - required: false 22 + required: true
23 - example: '1033954' 23 + example: manulife
24 schema: 24 schema:
25 type: string 25 type: string
26 - - name: user-token 26 + - name: a
27 - in: header 27 + in: query
28 description: '' 28 description: ''
29 - required: false 29 + required: true
30 - example: WN2BD9XQ7CRSVQ92FMB62V9C9OHHRBL38L2NS4GJ#1033954#50 30 + example: user
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: login
31 schema: 38 schema:
32 type: string 39 type: string
33 requestBody: 40 requestBody:
...@@ -36,32 +43,19 @@ paths: ...@@ -36,32 +43,19 @@ paths:
36 schema: 43 schema:
37 type: object 44 type: object
38 properties: 45 properties:
39 - f: 46 + uuid:
40 - example: behalo 47 + example: 预约核销1
41 - type: string
42 - a:
43 - example: user_edit
44 type: string 48 type: string
45 - name: 49 + password:
46 - description: 姓名 50 + example: '000000'
47 - example: 汪小雨XXXX
48 type: string 51 type: string
49 - avatar: 52 + openid:
50 - description: 头像 53 + description: 要绑定的小程序openid
51 example: '' 54 example: ''
52 type: string 55 type: string
53 - mobile: 56 + required:
54 - description: 手机号 57 + - uuid
55 - example: '' 58 + - password
56 - type: string
57 - sms_code:
58 - description: 短信验证码
59 - example: '8888'
60 - type: string
61 - idcard:
62 - description: 身份证
63 - example: '12345678'
64 - type: string
65 examples: {} 59 examples: {}
66 responses: 60 responses:
67 '200': 61 '200':
...@@ -73,11 +67,9 @@ paths: ...@@ -73,11 +67,9 @@ paths:
73 properties: 67 properties:
74 code: 68 code:
75 type: integer 69 type: integer
76 - title: 状态
77 description: 0=失败,1=成功 70 description: 0=失败,1=成功
78 msg: 71 msg:
79 type: string 72 type: string
80 - title: 错误信息
81 x-apifox-orders: 73 x-apifox-orders:
82 - code 74 - code
83 - msg 75 - msg
...@@ -88,16 +80,14 @@ paths: ...@@ -88,16 +80,14 @@ paths:
88 x-apifox-name: 成功 80 x-apifox-name: 成功
89 x-apifox-ordering: 0 81 x-apifox-ordering: 0
90 security: [] 82 security: []
91 - x-apifox-folder: 个人信息 83 + x-apifox-folder: 用户
92 - x-apifox-status: tested 84 + x-apifox-status: released
93 - x-run-in-apifox: https://app.apifox.com/web/project/6084040/apis/api-275318897-run 85 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-413906666-run
94 components: 86 components:
95 schemas: {} 87 schemas: {}
96 responses: {} 88 responses: {}
97 securitySchemes: {} 89 securitySchemes: {}
98 -servers: 90 +servers: []
99 - - url: https://oa-dev.onwall.cn
100 - description: 测试环境
101 security: [] 91 security: []
102 92
103 ``` 93 ```
......
1 +# 退出登录
2 +
3 +## OpenAPI Specification
4 +
5 +```yaml
6 +openapi: 3.0.1
7 +info:
8 + title: ''
9 + version: 1.0.0
10 +paths:
11 + /srv/:
12 + post:
13 + summary: 退出登录
14 + deprecated: false
15 + description: ''
16 + tags:
17 + - 用户
18 + parameters:
19 + - name: f
20 + in: query
21 + description: ''
22 + required: true
23 + example: manulife
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: true
30 + example: user
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: logout
38 + schema:
39 + type: string
40 + requestBody:
41 + content:
42 + application/x-www-form-urlencoded:
43 + schema:
44 + type: object
45 + properties: {}
46 + examples: {}
47 + responses:
48 + '200':
49 + description: ''
50 + content:
51 + application/json:
52 + schema:
53 + type: object
54 + properties:
55 + code:
56 + type: integer
57 + description: 0=失败,1=成功
58 + msg:
59 + type: string
60 + x-apifox-orders:
61 + - code
62 + - msg
63 + required:
64 + - code
65 + - msg
66 + headers: {}
67 + x-apifox-name: 成功
68 + x-apifox-ordering: 0
69 + security: []
70 + x-apifox-folder: 用户
71 + x-apifox-status: released
72 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-413906667-run
73 +components:
74 + schemas: {}
75 + responses: {}
76 + securitySchemes: {}
77 +servers: []
78 +security: []
79 +
80 +```
1 +# 更新个人资料
2 +
3 +## OpenAPI Specification
4 +
5 +```yaml
6 +openapi: 3.0.1
7 +info:
8 + title: ''
9 + version: 1.0.0
10 +paths:
11 + /srv/:
12 + post:
13 + summary: 更新个人资料
14 + deprecated: false
15 + description: ''
16 + tags:
17 + - 用户
18 + parameters:
19 + - name: f
20 + in: query
21 + description: ''
22 + required: true
23 + example: manulife
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: true
30 + example: user
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: update_profile
38 + schema:
39 + type: string
40 + requestBody:
41 + content:
42 + application/json:
43 + schema:
44 + type: object
45 + properties:
46 + avatar_url:
47 + type: string
48 + required:
49 + - avatar_url
50 + x-apifox-orders:
51 + - avatar_url
52 + example:
53 + avatar_url: http://.../new_avatar.jpg
54 + responses:
55 + '200':
56 + description: ''
57 + content:
58 + application/json:
59 + schema:
60 + type: object
61 + properties:
62 + code:
63 + type: integer
64 + description: 0=失败,1=成功
65 + msg:
66 + type: string
67 + x-apifox-orders:
68 + - code
69 + - msg
70 + required:
71 + - code
72 + - msg
73 + headers: {}
74 + x-apifox-name: 成功
75 + x-apifox-ordering: 0
76 + security: []
77 + x-apifox-folder: 用户
78 + x-apifox-status: released
79 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-413906669-run
80 +components:
81 + schemas: {}
82 + responses: {}
83 + securitySchemes: {}
84 +servers: []
85 +security: []
86 +
87 +```
1 +# 小程序授权
2 +
3 +## OpenAPI Specification
4 +
5 +```yaml
6 +openapi: 3.0.1
7 +info:
8 + title: ''
9 + version: 1.0.0
10 +paths:
11 + /srv/:
12 + post:
13 + summary: 小程序授权
14 + deprecated: false
15 + description: |
16 + # 登录流程设计
17 + - 先小程序授权
18 + - 如果返回 user 为空,则需要调用登录接口
19 + - 如果返回 user 非空,则不需要调用登录接口,授权接口内部按照openid绑定的账号,自动登录
20 + tags:
21 + - 微信
22 + parameters:
23 + - name: f
24 + in: query
25 + description: ''
26 + required: true
27 + example: manulife
28 + schema:
29 + type: string
30 + - name: a
31 + in: query
32 + description: 文件夹名称
33 + required: true
34 + example: openid
35 + schema:
36 + type: string
37 + - name: t
38 + in: query
39 + description: 接口的具体功能
40 + required: true
41 + example: wxapp
42 + schema:
43 + type: string
44 + - name: code
45 + in: query
46 + description: ''
47 + required: true
48 + example: ''
49 + schema:
50 + type: string
51 + - name: openid
52 + in: query
53 + description: 指定一个openid用来测试
54 + required: true
55 + example: oAHBN10P-hn-vF1cTY4tQeStQFmU
56 + schema:
57 + type: string
58 + responses:
59 + '200':
60 + description: ''
61 + content:
62 + application/json:
63 + schema:
64 + type: object
65 + properties:
66 + code:
67 + type: integer
68 + description: 0=失败,1=成功
69 + msg:
70 + type: string
71 + data:
72 + type: object
73 + properties:
74 + user:
75 + type: object
76 + properties:
77 + id:
78 + type: integer
79 + title: 用户ID
80 + avatar_url:
81 + type: string
82 + title: 头像
83 + name:
84 + type: string
85 + title: 姓名
86 + x-apifox-orders:
87 + - id
88 + - name
89 + - avatar_url
90 + title: openid绑定的用户信息
91 + required:
92 + - id
93 + - avatar_url
94 + - name
95 + x-apifox-orders:
96 + - user
97 + required:
98 + - user
99 + x-apifox-orders:
100 + - code
101 + - msg
102 + - data
103 + required:
104 + - code
105 + - msg
106 + - data
107 + headers: {}
108 + x-apifox-name: 成功
109 + x-apifox-ordering: 0
110 + security: []
111 + x-apifox-folder: 微信
112 + x-apifox-status: released
113 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-413906665-run
114 +components:
115 + schemas: {}
116 + responses: {}
117 + securitySchemes: {}
118 +servers: []
119 +security: []
120 +
121 +```
...@@ -59,6 +59,193 @@ function toPascalCase(str) { ...@@ -59,6 +59,193 @@ function toPascalCase(str) {
59 } 59 }
60 60
61 /** 61 /**
62 + * 简单的英文到中文翻译
63 + * @param {string} text - 英文文本
64 + * @returns {string} - 中文文本
65 + */
66 +function translateToChinese(text) {
67 + if (!text) return '';
68 +
69 + // 常见技术术语翻译字典(优先级从高到低)
70 + const dictionary = {
71 + // 短语和完整句子
72 + 'mini program authorization': '小程序授权',
73 + 'login flow design': '登录流程设计',
74 +
75 + // 短语
76 + 'mini program': '小程序',
77 + 'mini-program': '小程序',
78 + 'wechat': '微信',
79 + 'weixin': '微信',
80 + 'openid': 'OpenID',
81 +
82 + // 动词和常用词
83 + 'authorize': '授权',
84 + 'authorization': '授权',
85 + 'login': '登录',
86 + 'logout': '登出',
87 + 'register': '注册',
88 + 'call': '调用',
89 + 'return': '返回',
90 + 'using': '使用',
91 + 'bound to': '绑定到',
92 + 'according to': '根据',
93 +
94 + // 名词
95 + 'user': '用户',
96 + 'code': '授权码',
97 + 'token': '令牌',
98 + 'session': '会话',
99 + 'request': '请求',
100 + 'response': '响应',
101 + 'interface': '接口',
102 + 'api': '接口',
103 + 'account': '账号',
104 + 'openid': 'OpenID',
105 +
106 + // 描述性词汇
107 + 'first': '首先',
108 + 'then': '然后',
109 + 'if': '如果',
110 + 'else': '否则',
111 + 'need': '需要',
112 + 'should': '应该',
113 + 'must': '必须',
114 +
115 + // 状态
116 + 'success': '成功',
117 + 'fail': '失败',
118 + 'error': '错误',
119 + 'empty': '空',
120 + 'non-empty': '非空',
121 +
122 + // 属性
123 + 'avatar': '头像',
124 + 'name': '姓名',
125 + 'id': 'ID',
126 + 'info': '信息',
127 + 'data': '数据',
128 + 'flow': '流程',
129 + 'design': '设计',
130 +
131 + // 其他
132 + 'internal': '内部',
133 + 'automatically': '自动',
134 + 'specify': '指定',
135 + 'testing': '测试',
136 + 'used for': '用于',
137 + 'bound with': '绑定',
138 + };
139 +
140 + let translated = text;
141 +
142 + // 按照字典进行替换(优先匹配长词)
143 + const sortedKeys = Object.keys(dictionary).sort((a, b) => b.length - a.length);
144 + sortedKeys.forEach(key => {
145 + const regex = new RegExp(key, 'gi');
146 + translated = translated.replace(regex, dictionary[key]);
147 + });
148 +
149 + return translated;
150 +}
151 +
152 +/**
153 + * 格式化描述文本(翻译+格式化)
154 + * @param {string} description - 原始描述
155 + * @returns {string} - 格式化后的描述
156 + */
157 +function formatDescription(description) {
158 + if (!description) return '';
159 +
160 + // 移除 markdown 格式符号(如 # 标题)
161 + let formatted = description
162 + .replace(/^#+\s*/gm, '') // 移除标题符号
163 + .replace(/\*\*(.*?)\*\*/g, '$1') // 移除加粗
164 + .replace(/\*(.*?)\*/g, '$1') // 移除斜体
165 + .replace(/`([^`]+)`/g, '$1') // 移除行内代码
166 + .trim();
167 +
168 + // 先进行整句翻译(常见句式)
169 + formatted = translateSentences(formatted);
170 +
171 + return formatted;
172 +}
173 +
174 +/**
175 + * 翻译常见句式
176 + * @param {string} text - 文本
177 + * @returns {string} - 翻译后的文本
178 + */
179 +function translateSentences(text) {
180 + if (!text) return '';
181 +
182 + // 常见句式翻译(按优先级排序,长的先匹配)
183 + const sentences = {
184 + // 完整句子
185 + '# 登录流程设计': '# 登录流程设计',
186 + '# Login Flow Design': '# 登录流程设计',
187 +
188 + // 常见句式
189 + 'Authorize mini program first': '先进行小程序授权',
190 + 'If user is empty, call login API': '如果返回 user 为空,则需要调用登录接口',
191 + 'If user is not empty, no need to call login API': '如果返回 user 非空,则不需要调用登录接口',
192 + 'the authorization API will automatically login using the account bound to openid': '授权接口内部按照 openid 绑定的账号,自动登录',
193 + 'Specify an openid for testing': '指定一个 openid 用来测试',
194 + 'User information bound to openid': 'openid 绑定的用户信息',
195 + '0=fail, 1=success': '0=失败,1=成功',
196 + };
197 +
198 + let translated = text;
199 +
200 + // 按长度排序(长句优先)
201 + const sortedKeys = Object.keys(sentences).sort((a, b) => b.length - a.length);
202 + sortedKeys.forEach(key => {
203 + const regex = new RegExp(escapeRegExp(key), 'gi');
204 + translated = translated.replace(regex, sentences[key]);
205 + });
206 +
207 + // 最后进行单词级别的补充翻译
208 + translated = translateWords(translated);
209 +
210 + return translated;
211 +}
212 +
213 +/**
214 + * 转义正则表达式特殊字符
215 + * @param {string} string - 字符串
216 + * @returns {string} - 转义后的字符串
217 + */
218 +function escapeRegExp(string) {
219 + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
220 +}
221 +
222 +/**
223 + * 单词级别的翻译(补充)
224 + * @param {string} text - 文本
225 + * @returns {string} - 翻译后的文本
226 + */
227 +function translateWords(text) {
228 + const dictionary = {
229 + 'mini program': '小程序',
230 + 'wechat': '微信',
231 + 'openid': 'OpenID',
232 + 'user': '用户',
233 + 'authorization': '授权',
234 + 'login': '登录',
235 + 'avatar': '头像',
236 + 'name': '姓名',
237 + };
238 +
239 + let translated = text;
240 + Object.entries(dictionary).forEach(([key, value]) => {
241 + const regex = new RegExp(key, 'gi');
242 + translated = translated.replace(regex, value);
243 + });
244 +
245 + return translated;
246 +}
247 +
248 +/**
62 * 解析对象属性,生成字段描述 249 * 解析对象属性,生成字段描述
63 * @param {object} properties - 属性对象 250 * @param {object} properties - 属性对象
64 * @param {number} indent - 缩进级别 251 * @param {number} indent - 缩进级别
...@@ -147,8 +334,8 @@ function generateParamJSDoc(parameters, bodyParams, method) { ...@@ -147,8 +334,8 @@ function generateParamJSDoc(parameters, bodyParams, method) {
147 334
148 // POST 请求使用 body 参数 335 // POST 请求使用 body 参数
149 if (method === 'POST' && bodyParams && bodyParams.length > 0) { 336 if (method === 'POST' && bodyParams && bodyParams.length > 0) {
150 - // 过滤掉 a 和 f 参数 337 + // 过滤掉 a、f 和 t 参数(这些参数已硬编码到 URL 中)
151 - const filteredParams = bodyParams.filter(p => p.name !== 'a' && p.name !== 'f'); 338 + const filteredParams = bodyParams.filter(p => p.name !== 'a' && p.name !== 'f' && p.name !== 't');
152 339
153 filteredParams.forEach((param) => { 340 filteredParams.forEach((param) => {
154 const type = param.type || 'any'; 341 const type = param.type || 'any';
...@@ -159,8 +346,13 @@ function generateParamJSDoc(parameters, bodyParams, method) { ...@@ -159,8 +346,13 @@ function generateParamJSDoc(parameters, bodyParams, method) {
159 } 346 }
160 // GET 请求使用 query 参数 347 // GET 请求使用 query 参数
161 else if (method === 'GET' && parameters && parameters.length > 0) { 348 else if (method === 'GET' && parameters && parameters.length > 0) {
162 - // 只保留 query 参数,过滤 header 参数 349 + // 只保留 query 参数,过滤 header 参数和 a、f、t 参数
163 - const queryParams = parameters.filter(p => p.in === 'query' && p.name !== 'a' && p.name !== 'f'); 350 + const queryParams = parameters.filter(p =>
351 + p.in === 'query' &&
352 + p.name !== 'a' &&
353 + p.name !== 'f' &&
354 + p.name !== 't'
355 + );
164 356
165 queryParams.forEach((param) => { 357 queryParams.forEach((param) => {
166 const type = param.schema?.type || 'any'; 358 const type = param.schema?.type || 'any';
...@@ -243,29 +435,38 @@ function parseOpenAPIDocument(openapiDoc, fileName) { ...@@ -243,29 +435,38 @@ function parseOpenAPIDocument(openapiDoc, fileName) {
243 const parameters = apiInfo.parameters || []; 435 const parameters = apiInfo.parameters || [];
244 const queryParams = {}; 436 const queryParams = {};
245 let actionValue = ''; 437 let actionValue = '';
438 + let typeValue = ''; // t 参数
246 439
247 // 提取 body 参数(用于 POST 请求) 440 // 提取 body 参数(用于 POST 请求)
248 const requestBody = apiInfo.requestBody; 441 const requestBody = apiInfo.requestBody;
249 const bodyParams = extractRequestParams(requestBody); 442 const bodyParams = extractRequestParams(requestBody);
250 443
251 - // 对于 POST 请求,从 requestBody 中提取 action 444 + // 对于 POST 请求,从 requestBody 中提取 action 和 type
252 if (requestBody && bodyParams.length > 0) { 445 if (requestBody && bodyParams.length > 0) {
253 const actionParam = bodyParams.find(p => p.name === 'a'); 446 const actionParam = bodyParams.find(p => p.name === 'a');
254 if (actionParam) { 447 if (actionParam) {
255 actionValue = actionParam.example || ''; 448 actionValue = actionParam.example || '';
256 } 449 }
450 + const typeParam = bodyParams.find(p => p.name === 't');
451 + if (typeParam) {
452 + typeValue = typeParam.example || '';
453 + }
257 } 454 }
258 455
259 - // 对于 GET 请求,从 query 参数中提取 action 456 + // 对于 GET 请求,从 query 参数中提取 action 和 type
260 - if (!actionValue && parameters.length > 0) { 457 + if (parameters.length > 0) {
261 parameters.forEach((param) => { 458 parameters.forEach((param) => {
262 if (param.in === 'query') { 459 if (param.in === 'query') {
263 queryParams[param.name] = param.example || param.schema?.default || ''; 460 queryParams[param.name] = param.example || param.schema?.default || '';
264 461
265 // 提取 action 参数(通常是 'a' 参数) 462 // 提取 action 参数(通常是 'a' 参数)
266 - if (param.name === 'a') { 463 + if (param.name === 'a' && !actionValue) {
267 actionValue = param.example || ''; 464 actionValue = param.example || '';
268 } 465 }
466 + // 提取 type 参数('t' 参数)
467 + if (param.name === 't' && !typeValue) {
468 + typeValue = param.example || '';
469 + }
269 } 470 }
270 }); 471 });
271 } 472 }
...@@ -278,6 +479,7 @@ function parseOpenAPIDocument(openapiDoc, fileName) { ...@@ -278,6 +479,7 @@ function parseOpenAPIDocument(openapiDoc, fileName) {
278 description: apiInfo.description || '', 479 description: apiInfo.description || '',
279 method: method.toUpperCase(), 480 method: method.toUpperCase(),
280 action: actionValue, 481 action: actionValue,
482 + type: typeValue, // 保存 t 参数
281 queryParams, 483 queryParams,
282 parameters, // 保存完整的参数信息用于生成 JSDoc(GET 请求) 484 parameters, // 保存完整的参数信息用于生成 JSDoc(GET 请求)
283 bodyParams, // 保存 requestBody 参数用于生成 JSDoc(POST 请求) 485 bodyParams, // 保存 requestBody 参数用于生成 JSDoc(POST 请求)
...@@ -307,9 +509,16 @@ function generateApiFileContent(moduleName, apis) { ...@@ -307,9 +509,16 @@ function generateApiFileContent(moduleName, apis) {
307 // 生成函数名(驼峰命名 + API 后缀) 509 // 生成函数名(驼峰命名 + API 后缀)
308 const functionName = toCamelCase(api.fileName) + 'API'; 510 const functionName = toCamelCase(api.fileName) + 'API';
309 511
512 + // 构建 URL,包含 a 和 t 参数
513 + let url = '/srv/?';
514 + const params = [];
515 + if (api.action) params.push(`a=${api.action}`);
516 + if (api.type) params.push(`t=${api.type}`);
517 + url += params.join('&');
518 +
310 // 添加常量定义 519 // 添加常量定义
311 apiConstants.push( 520 apiConstants.push(
312 - ` ${constantName}: '/srv/?a=${api.action}',` 521 + ` ${constantName}: '${url}',`
313 ); 522 );
314 523
315 // 生成详细的 JSDoc 注释 524 // 生成详细的 JSDoc 注释
...@@ -318,8 +527,14 @@ function generateApiFileContent(moduleName, apis) { ...@@ -318,8 +527,14 @@ function generateApiFileContent(moduleName, apis) {
318 527
319 // 添加函数定义 528 // 添加函数定义
320 const fetchMethod = api.method === 'GET' ? 'fetch.get' : 'fetch.post'; 529 const fetchMethod = api.method === 'GET' ? 'fetch.get' : 'fetch.post';
530 +
531 + // 格式化描述
532 + const formattedDesc = formatDescription(api.description);
533 +
534 + // 生成 JSDoc 注释(包含描述)
321 const comment = `/** 535 const comment = `/**
322 - * @description: ${api.summary} 536 + * @description ${api.summary}
537 + * @remark ${formattedDesc}
323 ${paramJSDoc} 538 ${paramJSDoc}
324 ${returnJSDoc} 539 ${returnJSDoc}
325 */`; 540 */`;
......
1 +import { fn, fetch } from '@/api/fn';
2 +
3 +const Api = {
4 + List: '/srv/?a=feedback&t=list',
5 + SubmitFeedback: '/srv/?a=feedback&t=add',
6 +}
7 +
8 +/**
9 + * @description 意见反馈列表
10 + * @remark
11 + * @param {Object} params 请求参数
12 + * @param {string} params.page 页码,从0开始
13 + * @param {string} params.limit 每页数量
14 + * @returns {Promise<{
15 + * code: number; // 状态码
16 + * msg: string; // 消息
17 + * data: {
18 + * list: Array<{
19 + * id: integer; // 订单ID
20 + * status: integer; // 3=待处理, 5=已处理
21 + * category: string; // 1=功能建议, 3=界面设计, 5=车辆新鲜, 7=其他问题
22 + * images: string; // 图片
23 + * contact: string; // 联系方式
24 + * note: string; // 反馈内容
25 + * reply: string; // 回复
26 + * reply_time: string; // 回复时间
27 + * }>;
28 + * };
29 + * }>}
30 + */
31 +export const listAPI = (params) => fn(fetch.get(Api.List, params));
32 +
33 +/**
34 + * @description 提交意见反馈
35 + * @remark
36 + * @param {Object} params 请求参数
37 + * @param {string} params.category 反馈类别。1=功能建议, 3=界面设计, 5=车辆新鲜, 7=其他问题
38 + * @param {string} params.note 反馈内容
39 + * @param {string} params.contact 用户留下的联系方式
40 + * @param {string} params.images 图片
41 + * @returns {Promise<{
42 + * code: number; // 状态码
43 + * msg: string; // 消息
44 + * data: any;
45 + * }>}
46 + */
47 +export const submitFeedbackAPI = (params) => fn(fetch.post(Api.SubmitFeedback, params));
1 +import { fn, fetch } from '@/api/fn';
2 +
3 +const Api = {
4 + Detail: '/srv/?a=website_msg&t=detail',
5 + MyList: '/srv/?a=website_msg&t=my_list',
6 +}
7 +
8 +/**
9 + * @description 消息详情
10 + * @remark
11 + * @param {Object} params 请求参数
12 + * @param {string} params.i 消息ID
13 + * @returns {Promise<{
14 + * code: number; // 状态码
15 + * msg: string; // 消息
16 + * data: any;
17 + * }>}
18 + */
19 +export const detailAPI = (params) => fn(fetch.get(Api.Detail, params));
20 +
21 +/**
22 + * @description 我的消息列表
23 + * @remark
24 + * @param {Object} params 请求参数
25 + * @param {string} params.page
26 + * @param {string} params.limit
27 + * @returns {Promise<{
28 + * code: number; // 状态码
29 + * msg: string; // 消息
30 + * data: any;
31 + * }>}
32 + */
33 +export const myListAPI = (params) => fn(fetch.get(Api.MyList, params));
1 import { fn, fetch } from '@/api/fn'; 1 import { fn, fetch } from '@/api/fn';
2 2
3 const Api = { 3 const Api = {
4 - EditUserInfo: '/srv/?a=user_edit', 4 + GetProfile: '/srv/?a=user&t=get_profile',
5 - GetUserInfo: '/srv/?a=user_info', 5 + Login: '/srv/?a=user&t=login',
6 + Logout: '/srv/?a=user&t=logout',
7 + UpdateProfile: '/srv/?a=user&t=update_profile',
6 } 8 }
7 9
8 /** 10 /**
9 - * @description: 修改我的信息 11 + * @description 获取个人信息
12 + * @remark
10 * @param {Object} params 请求参数 13 * @param {Object} params 请求参数
11 - * @param {string} params.name (可选) 姓名 14 + * @returns {Promise<{
12 - * @param {string} params.avatar (可选) 头像 15 + * code: number; // 状态码
13 - * @param {string} params.mobile (可选) 手机号 16 + * msg: string; // 消息
14 - * @param {string} params.sms_code (可选) 短信验证码 17 + * data: {
15 - * @param {string} params.idcard (可选) 身份证 18 + * user: {
19 + * id: integer; // 用户ID
20 + * avatar_url: string; // 头像
21 + * name: string; // 姓名
22 + * };
23 + * };
24 + * }>}
25 + */
26 +export const getProfileAPI = (params) => fn(fetch.get(Api.GetProfile, params));
27 +
28 +/**
29 + * @description 登录并绑定openid
30 + * @remark
31 + * @param {Object} params 请求参数
32 + * @param {string} params.uuid
33 + * @param {string} params.password
34 + * @param {string} params.openid (可选) 要绑定的小程序openid
16 * @returns {Promise<{ 35 * @returns {Promise<{
17 * code: number; // 状态码 36 * code: number; // 状态码
18 * msg: string; // 消息 37 * msg: string; // 消息
19 * data: any; 38 * data: any;
20 * }>} 39 * }>}
21 */ 40 */
22 -export const editUserInfoAPI = (params) => fn(fetch.post(Api.EditUserInfo, params)); 41 +export const loginAPI = (params) => fn(fetch.post(Api.Login, params));
23 42
24 /** 43 /**
25 - * @description: 查询我的信息 44 + * @description 退出登录
45 + * @remark
26 * @param {Object} params 请求参数 46 * @param {Object} params 请求参数
27 * @returns {Promise<{ 47 * @returns {Promise<{
28 * code: number; // 状态码 48 * code: number; // 状态码
29 * msg: string; // 消息 49 * msg: string; // 消息
30 - * data: { 50 + * data: any;
31 - * user: { 51 + * }>}
32 - * id: integer; // 用户ID 52 + */
33 - * name: string; // 姓名 53 +export const logoutAPI = (params) => fn(fetch.post(Api.Logout, params));
34 - * mobile: string; // 手机号 54 +
35 - * }; 55 +/**
36 - * checkin: { 56 + * @description 更新个人资料
37 - * total_days: integer; // 累计打卡天数 57 + * @remark
38 - * consecutive_days: integer; // 连续打卡天 58 + * @param {Object} params 请求参
39 - * longest_consecutive_days: integer; // 最长连续打卡天数 59 + * @param {string} params.avatar_url
40 - * }; 60 + * @returns {Promise<{
41 - * unread_msg_count: integer; // 未读的消息数量 61 + * code: number; // 状态码
42 - * is_teacher: boolean; // 是不是老师 62 + * msg: string; // 消息
43 - * }; 63 + * data: any;
44 * }>} 64 * }>}
45 */ 65 */
46 -export const getUserInfoAPI = (params) => fn(fetch.get(Api.GetUserInfo, params)); 66 +export const updateProfileAPI = (params) => fn(fetch.post(Api.UpdateProfile, params));
......
1 +import { fn, fetch } from '@/api/fn';
2 +
3 +const Api = {
4 + MiniProgramAuth: '/srv/?a=openid&t=wxapp',
5 +}
6 +
7 +/**
8 + * @description 小程序授权
9 + * @remark 登录流程设计
10 +- 先小程序授权
11 +- 如果返回 用户 为空,则需要调用登录接口
12 +- 如果返回 用户 非空,则不需要调用登录接口,授权接口内部按照OpenID绑定的账号,自动登录
13 + * @param {Object} params 请求参数
14 + * @returns {Promise<{
15 + * code: number; // 状态码
16 + * msg: string; // 消息
17 + * data: {
18 + * user: {
19 + * id: integer; // 用户ID
20 + * avatar_url: string; // 头像
21 + * name: string; // 姓名
22 + * };
23 + * };
24 + * }>}
25 + */
26 +export const miniProgramAuthAPI = (params) => fn(fetch.post(Api.MiniProgramAuth, params));
1 /* 1 /*
2 * @Date: 2026-01-29 10:48:35 2 * @Date: 2026-01-29 10:48:35
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2026-01-29 17:56:45 4 + * @LastEditTime: 2026-02-02 15:28:09
5 * @FilePath: /manulife-weapp/src/utils/config.js 5 * @FilePath: /manulife-weapp/src/utils/config.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -24,10 +24,11 @@ const BASE_URL = process.env.NODE_ENV === 'production' ...@@ -24,10 +24,11 @@ const BASE_URL = process.env.NODE_ENV === 'production'
24 * 接口默认公共参数(避免在多个文件里硬编码) 24 * 接口默认公共参数(避免在多个文件里硬编码)
25 * - f:业务模块标识(请修改为您的业务模块) 25 * - f:业务模块标识(请修改为您的业务模块)
26 * - client_name:客户端标识(请修改为您的应用名称) 26 * - client_name:客户端标识(请修改为您的应用名称)
27 + * - a: 文件夹名称
28 + * - t :接口的具体功能
27 */ 29 */
28 export const REQUEST_DEFAULT_PARAMS = { 30 export const REQUEST_DEFAULT_PARAMS = {
29 - f: 'YOUR_MODULE', // 🔧 修改为业务模块标识 31 + f: 'manulife', // 🔧 修改为业务模块标识
30 - client_name: 'YOUR_APP', // 🔧 修改为应用名称
31 } 32 }
32 33
33 /** 34 /**
......