更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -14,13 +14,6 @@ import (
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
// PlatformAuthIdpController 统一认证 —— 第三方登录配置(平台端管理)
|
||||
//
|
||||
// 配置说明:
|
||||
// - tid = 0 :平台全局配置,所有租户共用
|
||||
// - tid > 0 :租户自带身份源,仅该租户可见(第10条需求:企业自带钉钉/飞书等)
|
||||
//
|
||||
// 配置对象只有「租户用户登录」,平台端自身不使用第三方登录。
|
||||
type PlatformAuthIdpController struct {
|
||||
beego.Controller
|
||||
}
|
||||
@@ -30,7 +23,6 @@ func (c *PlatformAuthIdpController) serveJSON(data map[string]interface{}) {
|
||||
_ = c.ServeJSON()
|
||||
}
|
||||
|
||||
// Prepare 统一鉴权:仅平台管理员可维护第三方登录配置
|
||||
func (c *PlatformAuthIdpController) Prepare() {
|
||||
if _, err := identity.Claims(c.Ctx.Request.Header.Get("Authorization"), identity.EndPlatform); err != nil {
|
||||
code := identity.Status(err)
|
||||
@@ -67,8 +59,6 @@ func (c *PlatformAuthIdpController) parsePayload() (authIdpPayload, bool) {
|
||||
return p, true
|
||||
}
|
||||
|
||||
// List 配置列表
|
||||
// GET /platform/authIdp/list?tid=0
|
||||
func (c *PlatformAuthIdpController) List() {
|
||||
tid, _ := c.GetInt64("tid", 0)
|
||||
var rows []models.AuthTenantIdp
|
||||
@@ -78,7 +68,6 @@ func (c *PlatformAuthIdpController) List() {
|
||||
return
|
||||
}
|
||||
|
||||
// 脱敏:不下发 AppSecret
|
||||
list := make([]map[string]interface{}, 0, len(rows))
|
||||
for _, r := range rows {
|
||||
list = append(list, map[string]interface{}{
|
||||
@@ -102,8 +91,6 @@ func (c *PlatformAuthIdpController) List() {
|
||||
})
|
||||
}
|
||||
|
||||
// Create 新增配置
|
||||
// POST /platform/authIdp/create
|
||||
func (c *PlatformAuthIdpController) Create() {
|
||||
p, ok := c.parsePayload()
|
||||
if !ok {
|
||||
@@ -137,8 +124,6 @@ func (c *PlatformAuthIdpController) Create() {
|
||||
c.serveJSON(map[string]interface{}{"code": 200, "msg": "success", "data": map[string]interface{}{"id": id}})
|
||||
}
|
||||
|
||||
// Edit 编辑配置(app_secret 留空表示不修改)
|
||||
// POST /platform/authIdp/edit/:id
|
||||
func (c *PlatformAuthIdpController) Edit() {
|
||||
id, err := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
|
||||
if err != nil || id == 0 {
|
||||
@@ -165,8 +150,6 @@ func (c *PlatformAuthIdpController) Edit() {
|
||||
c.serveJSON(map[string]interface{}{"code": 200, "msg": "success"})
|
||||
}
|
||||
|
||||
// Delete 删除配置
|
||||
// DELETE /platform/authIdp/delete/:id
|
||||
func (c *PlatformAuthIdpController) Delete() {
|
||||
id, err := strconv.ParseUint(c.Ctx.Input.Param(":id"), 10, 64)
|
||||
if err != nil || id == 0 {
|
||||
@@ -180,8 +163,6 @@ func (c *PlatformAuthIdpController) Delete() {
|
||||
c.serveJSON(map[string]interface{}{"code": 200, "msg": "success"})
|
||||
}
|
||||
|
||||
// CallbackHint 返回各平台需要填写的回调地址(方便复制)
|
||||
// GET /platform/authIdp/callbackHint?provider=wechat
|
||||
func (c *PlatformAuthIdpController) CallbackHint() {
|
||||
provider := strings.TrimSpace(c.GetString("provider"))
|
||||
base := jwtutil.Issuer()
|
||||
@@ -200,9 +181,6 @@ func (c *PlatformAuthIdpController) CallbackHint() {
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- 工具
|
||||
|
||||
// fillAuthIdp 把请求参数写入模型;留空字段表示不修改
|
||||
func fillAuthIdp(item *models.AuthTenantIdp, p *authIdpPayload) {
|
||||
if v := strings.TrimSpace(p.Name); v != "" {
|
||||
item.Name = &v
|
||||
|
||||
Reference in new issue
Block a user