You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB
Go

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package auth
import (
"net/http"
"git.noahlan.cn/noahlan/ntool-biz/zero/statusz"
"github.com/zeromicro/go-zero/rest/httpx"
"git.noahlan.cn/n-admin/n-admin-server/api/internal/logic/auth"
"git.noahlan.cn/n-admin/n-admin-server/api/internal/svc"
"git.noahlan.cn/n-admin/n-admin-server/api/internal/types"
)
// swagger:route get /api/auth/oauth/login auth OauthLogin
//
// Oauth log in | Oauth 第三方登录获取登录地址通常针对PC网页登录APP端自行获取code
//
// Oauth log in | Oauth 第三方登录获取登录地址通常针对PC网页登录APP端自行获取code
//
// Responses:
// 200: OauthLoginResp
func OauthLoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
const transErr = true
var req types.OauthLoginReq
if err := httpx.Parse(r, &req); err != nil {
statusz.ResponseHandler(r, w, transErr, nil, err)
return
}
l := auth.NewOauthLoginLogic(r, r.Context(), svcCtx)
resp, err := l.OauthLogin(&req)
statusz.ResponseHandler(r, w, transErr, resp, err)
}
}