更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -16,12 +16,10 @@ type AppActivityController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
// 只放行移动端与租户端令牌:/api/** 仅被 uniapp 调用,平台令牌不该能打移动端接口。
|
||||
func (c *AppActivityController) activityClaims() (*jwtutil.Claims, error) {
|
||||
return identity.Claims(c.Ctx.Request.Header.Get("Authorization"), identity.EndApp, identity.EndBackend)
|
||||
}
|
||||
|
||||
// GetList GET /app/activity/list
|
||||
func (c *AppActivityController) GetList() {
|
||||
claims, err := c.activityClaims()
|
||||
if err != nil {
|
||||
@@ -65,7 +63,6 @@ func (c *AppActivityController) GetList() {
|
||||
module := l.Module
|
||||
action := l.Action
|
||||
|
||||
// 从请求体中提取标题
|
||||
title := extractTitle(l.Module, l.Action, l.RequestData)
|
||||
if title == "" {
|
||||
title = fmt.Sprintf("您%s了:%s", actionLabel(action), moduleLabel(module))
|
||||
@@ -85,7 +82,6 @@ func (c *AppActivityController) GetList() {
|
||||
_ = c.ServeJSON()
|
||||
}
|
||||
|
||||
// extractTitle 从请求数据中提取可读标题
|
||||
func extractTitle(module, action string, reqData *string) string {
|
||||
if reqData == nil {
|
||||
return ""
|
||||
@@ -95,7 +91,6 @@ func extractTitle(module, action string, reqData *string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// 解析 JSON 请求体
|
||||
var body map[string]interface{}
|
||||
if err := json.Unmarshal([]byte(data), &body); err != nil {
|
||||
return ""
|
||||
@@ -104,14 +99,12 @@ func extractTitle(module, action string, reqData *string) string {
|
||||
moduleCN := moduleLabel(module)
|
||||
actionCN := actionLabel(action)
|
||||
|
||||
// 笔记本:取 title
|
||||
if module == "notebook" {
|
||||
if t, ok := body["title"].(string); ok && t != "" {
|
||||
return fmt.Sprintf("您%s了%s:【%s】", actionCN, moduleCN, truncateStr(t, 20))
|
||||
}
|
||||
}
|
||||
|
||||
// 日程:取 content 第一行
|
||||
if module == "schedule" {
|
||||
if c, ok := body["content"].(string); ok && c != "" {
|
||||
firstLine := strings.SplitN(c, "\n", 2)[0]
|
||||
|
||||
Reference in new issue
Block a user