app端取消用户注册和token验证,改为按设备ID识别用户
- 删除注册、登录、找回密码、游客登录接口及密码、token 相关代码 - 鉴权中间件不再校验 token,按 X-User-Agent 中的 devID 识别用户,首次访问自动创建,Redis 缓存 10 分钟 - 渠道码改从请求头 channel 读取;修改资料不再支持改密码 - 同步更新 swagger 文档 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+3
-280
@@ -56,7 +56,7 @@
|
||||
},
|
||||
"/api/app/auth/getInfo": {
|
||||
"get": {
|
||||
"description": "通过 token 获取最新用户信息,包含金币余额、VIP状态等",
|
||||
"description": "按请求头 X-User-Agent 中的 devID 识别用户,返回最新用户信息,包含金币余额、VIP状态等",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -80,89 +80,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/auth/guest": {
|
||||
"post": {
|
||||
"description": "按设备ID创建或找回游客账号;请求头可带 Authorization 复用已有游客会话。需传 X-User-Agent",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户认证"
|
||||
],
|
||||
"summary": "游客登录",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "游客登录参数",
|
||||
"name": "param",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/authser.GuestLoginReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "成功",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/authser.LoginResp"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "失败",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/auth/login": {
|
||||
"post": {
|
||||
"description": "账号或邮箱均可作为登录凭证",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户认证"
|
||||
],
|
||||
"summary": "登录",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "登录参数",
|
||||
"name": "param",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/authapi.loginReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "登录成功,返回 token 及用户基本信息",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/authser.LoginResp"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "失败",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/auth/profile": {
|
||||
"post": {
|
||||
"description": "用户信息通过 token 获取,无需传账号;nickName、avatar、introduction、oldPassword+newPassword 均为可选,至少提供一项。修改密码时旧密码和新密码必须同时提供。",
|
||||
"description": "按请求头 X-User-Agent 中的 devID 识别用户;nickName、avatar、introduction、privacyMode 均为可选,至少提供一项。",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -172,7 +92,7 @@
|
||||
"tags": [
|
||||
"用户认证"
|
||||
],
|
||||
"summary": "修改用户资料(头像 / 简介 / 密码,可任意组合)",
|
||||
"summary": "修改用户资料(昵称 / 头像 / 简介 / 隐私模式,可任意组合)",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "修改资料参数",
|
||||
@@ -200,86 +120,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/auth/register": {
|
||||
"post": {
|
||||
"description": "传入账号、邮箱、明文密码。请求头带游客 Authorization 时升级该游客为普通用户,否则新建用户",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户认证"
|
||||
],
|
||||
"summary": "注册",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "注册参数",
|
||||
"name": "param",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/authapi.registerReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "注册成功,返回 token 及用户基本信息",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/authser.LoginResp"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "失败",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/auth/resetPassword": {
|
||||
"post": {
|
||||
"description": "通过账号和邮箱双重校验后重置密码,两者必须同时匹配同一用户",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户认证"
|
||||
],
|
||||
"summary": "找回密码",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "找回密码参数",
|
||||
"name": "param",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/authapi.resetPasswordReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "成功",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "失败",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/coin/buy": {
|
||||
"post": {
|
||||
"security": [
|
||||
@@ -2293,87 +2133,6 @@
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"authapi.loginReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"account",
|
||||
"password"
|
||||
],
|
||||
"properties": {
|
||||
"account": {
|
||||
"description": "账号或邮箱",
|
||||
"type": "string"
|
||||
},
|
||||
"channel": {
|
||||
"description": "渠道码(可选,用户无商区码时写入)",
|
||||
"type": "string"
|
||||
},
|
||||
"devID": {
|
||||
"description": "设备唯一标示(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"description": "明文密码",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"authapi.registerReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"accountNo",
|
||||
"email",
|
||||
"password"
|
||||
],
|
||||
"properties": {
|
||||
"accountNo": {
|
||||
"description": "账号",
|
||||
"type": "string"
|
||||
},
|
||||
"agentInviteCode": {
|
||||
"description": "邀请人的邀请码(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"channel": {
|
||||
"description": "渠道码(可选,用户无商区码时写入)",
|
||||
"type": "string"
|
||||
},
|
||||
"devID": {
|
||||
"description": "设备唯一标示(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"description": "邮箱",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"description": "明文密码",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"authapi.resetPasswordReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"accountNo",
|
||||
"email",
|
||||
"newPassword"
|
||||
],
|
||||
"properties": {
|
||||
"accountNo": {
|
||||
"description": "账号",
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"description": "邮箱",
|
||||
"type": "string"
|
||||
},
|
||||
"newPassword": {
|
||||
"description": "新密码",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"authapi.updateProfileReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -2385,45 +2144,16 @@
|
||||
"description": "简介(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"newPassword": {
|
||||
"description": "新密码明文(修改密码时必填)",
|
||||
"type": "string"
|
||||
},
|
||||
"nickName": {
|
||||
"description": "新昵称(可选)",
|
||||
"type": "string"
|
||||
},
|
||||
"oldPassword": {
|
||||
"description": "旧密码明文(修改密码时必填)",
|
||||
"type": "string"
|
||||
},
|
||||
"privacyMode": {
|
||||
"description": "隐私模式:true-开启,false-关闭(可选)",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"authser.GuestLoginReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"channel": {
|
||||
"description": "渠道码(可选,用户无商区码时写入 DistrictCode)",
|
||||
"type": "string"
|
||||
},
|
||||
"devID": {
|
||||
"description": "设备唯一标示(必填)",
|
||||
"type": "string"
|
||||
},
|
||||
"deviceId": {
|
||||
"description": "备用设备ID(可选,写入 DevV2)",
|
||||
"type": "string"
|
||||
},
|
||||
"mac": {
|
||||
"description": "设备 Mac(可选)",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"authser.LoginResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -2449,10 +2179,6 @@
|
||||
"description": "邀请码",
|
||||
"type": "string"
|
||||
},
|
||||
"isNewUser": {
|
||||
"description": "本次是否新建游客",
|
||||
"type": "boolean"
|
||||
},
|
||||
"isRegister": {
|
||||
"description": "是否已注册",
|
||||
"type": "boolean"
|
||||
@@ -2491,9 +2217,6 @@
|
||||
"status": {
|
||||
"$ref": "#/definitions/pubdef.UserStatus"
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "身份类型:0游客 1普通用户",
|
||||
"allOf": [
|
||||
|
||||
Reference in New Issue
Block a user