refactor: remove commented-out API route configuration for clarity
This commit is contained in:
@@ -102,12 +102,6 @@ func addRouter(app *iris.Application) {
|
||||
m.Party("/message", middleware.ExternalInfoMiddleware).Handle(new(api.MessageController))
|
||||
})
|
||||
|
||||
// mvc.Configure(app.Party("/api/open/im", middleware.ChannelContextMiddleware), func(m *mvc.Application) {
|
||||
// m.Party("/widget").Handle(new(api.ImWidgetController))
|
||||
// m.Party("/conversation").Handle(new(api.ConversationController))
|
||||
// m.Party("/message").Handle(new(api.MessageController))
|
||||
// })
|
||||
|
||||
mvc.Configure(app.Party("/api/dashboard", middleware.AuthMiddleware), func(m *mvc.Application) {
|
||||
m.Party("/dashboard").Handle(new(dashboard.DashboardController))
|
||||
m.Party("/user").Handle(new(dashboard.UserController))
|
||||
|
||||
@@ -31,8 +31,7 @@ func OpenImWsMiddleware(ctx iris.Context) {
|
||||
_ = ctx.StopWithJSON(iris.StatusBadRequest, web.JsonErrorMsg("接入渠道不存在或已停用"))
|
||||
return
|
||||
}
|
||||
// 与 Open IM HTTP 一致:优先站内 AuthPrincipal;否则使用外部访客身份(Header/query,见 openidentity)。
|
||||
// 二者不应在业务上同时作为「客户身份」使用;本入口在 principal 非空时不再解析 external,避免语义冲突。
|
||||
|
||||
principal := services.AuthService.GetAuthPrincipal(ctx)
|
||||
var external *openidentity.ExternalInfo
|
||||
if principal == nil {
|
||||
|
||||
Reference in New Issue
Block a user