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:
@@ -9,11 +9,7 @@ import (
|
||||
func authRouter(r *gin.Engine) {
|
||||
auth := r.Group("/api/app/auth")
|
||||
{
|
||||
auth.POST("/guest", authapi.GuestLogin)
|
||||
auth.POST("/register", authapi.Register)
|
||||
auth.POST("/login", authapi.Login)
|
||||
auth.GET("/getInfo", authapi.GetInfo)
|
||||
auth.POST("/profile", authapi.UpdateProfile)
|
||||
auth.POST("/resetPassword", authapi.ResetPassword)
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -79,14 +79,14 @@ func registeMiddleware(engine *gin.Engine) {
|
||||
Methods: []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodHead, http.MethodDelete},
|
||||
AllowedHeaders: []string{
|
||||
"Content-Length", "Content-Type", "Authorization", "X-User-Agent",
|
||||
"device", "api_version", "x-api-key",
|
||||
"device", "api_version", "x-api-key", "channel",
|
||||
"sid",
|
||||
"device_brand", "device-brand",
|
||||
"device_model", "device-model",
|
||||
"system_name", "system-name",
|
||||
"system_version", "system-version",
|
||||
},
|
||||
ExposedHeaders: []string{"Content-Disposition", "Refresh-Authorization"},
|
||||
ExposedHeaders: []string{"Content-Disposition"},
|
||||
OptionsSuccessStatus: http.StatusOK,
|
||||
}),
|
||||
// 必须是此顺序, happens before原则
|
||||
|
||||
Reference in New Issue
Block a user