更新密码找回uniapp

This commit is contained in:
hero920103 committed 2026-11-16 17:22:50 +08:00
1 parent 7f9a66da0f
commit 3fdda89833
1304 files changed
+3503 -26132

No files matched your search

-14
View File
@@ -12,13 +12,6 @@ import (
beego "github.com/beego/beego/v2/server/web"
)
// AppMiniSubscribeController 小程序订阅消息(uniapp 调用)
//
// 订阅消息是「用户 → 授权 → 服务器主动推给用户」的链路:
// 1. GET /api/mini/subscribe/templates 取当前可订阅的模板(含模板ID与跳转页)
// 2. 小程序端调 uni.requestSubscribeMessage 弹授权窗,用户同意后
// 3. POST /api/mini/subscribe/authorize 上报授权结果,服务器记录一次发送机会
// 4. 之后业务侧发站内信/审批待办时,服务器自动用掉这次机会推送
type AppMiniSubscribeController struct {
beego.Controller
}
@@ -41,8 +34,6 @@ func (c *AppMiniSubscribeController) ok(data interface{}, msg string) {
_ = c.ServeJSON()
}
// Templates GET /api/mini/subscribe/templates
// 返回当前启用的订阅模板:小程序端拿 template_id 去调 requestSubscribeMessage
func (c *AppMiniSubscribeController) Templates() {
claims, err := c.appClaims()
if err != nil {
@@ -83,8 +74,6 @@ func (c *AppMiniSubscribeController) Templates() {
c.ok(map[string]interface{}{"list": list}, "获取成功")
}
// Authorize POST /api/mini/subscribe/authorize
// 上报用户授权结果:每授权一次,服务器记录一次可发送机会
func (c *AppMiniSubscribeController) Authorize() {
claims, err := c.appClaims()
if err != nil {
@@ -119,7 +108,6 @@ func (c *AppMiniSubscribeController) Authorize() {
if app.Enabled != 1 {
continue
}
// 只记录平台确实配置过的模板
for _, tid := range p.TemplateIDs {
tid = strings.TrimSpace(tid)
if tid == "" {
@@ -147,8 +135,6 @@ func (c *AppMiniSubscribeController) Authorize() {
c.ok(map[string]interface{}{"granted": granted}, "已记录授权")
}
// TestNotice POST /api/mini/subscribe/test
// 给自己发一条测试订阅消息(用于验证模板配置是否正确)
func (c *AppMiniSubscribeController) TestNotice() {
claims, err := c.appClaims()
if err != nil {