fix: 密码重置链路断裂与店铺模板类型不兼容
删除 users-api 的 forgot-password 空壳路由,email-api 的
forgotPasswordLogic 复用 sendVerificationCode 实现。shop 的
UpdateTemplateReq.Sections 从 interface{} 改为 string 以兼容
go-zero 反序列化。ResetPasswordReq.Phone 加 optional tag。
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.9.2
|
||||
// goctl 1.10.1
|
||||
|
||||
package handler
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ package shop
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"juwan-backend/app/shop/api/internal/svc"
|
||||
@@ -48,11 +47,6 @@ func (l *UpdateShopTemplateLogic) UpdateShopTemplate(req *types.UpdateTemplateRe
|
||||
return nil, contextj.ERRILLEGALUSER
|
||||
}
|
||||
|
||||
templateBytes, err := json.Marshal(map[string]any{"sections": req.Sections})
|
||||
if err != nil {
|
||||
return nil, errors.New("invalid sections")
|
||||
}
|
||||
|
||||
_, err = l.svcCtx.ShopRpc.UpdateShops(l.ctx, &pb.UpdateShopsReq{
|
||||
Id: shop.Shops.Id,
|
||||
OwnerId: shop.Shops.OwnerId,
|
||||
@@ -68,7 +62,7 @@ func (l *UpdateShopTemplateLogic) UpdateShopTemplate(req *types.UpdateTemplateRe
|
||||
AllowIndependentOrders: shop.Shops.AllowIndependentOrders,
|
||||
DispatchMode: shop.Shops.DispatchMode,
|
||||
Announcements: shop.Shops.Announcements,
|
||||
TemplateConfig: string(templateBytes),
|
||||
TemplateConfig: req.Sections,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.9.2
|
||||
// goctl 1.10.1
|
||||
|
||||
package types
|
||||
|
||||
@@ -93,8 +93,8 @@ type UpdateShopReq struct {
|
||||
}
|
||||
|
||||
type UpdateTemplateReq struct {
|
||||
Id int64 `path:"id"`
|
||||
Sections interface{} `json:"sections"`
|
||||
Id int64 `path:"id"`
|
||||
Sections string `json:"sections"`
|
||||
}
|
||||
|
||||
type UserIdReq struct {
|
||||
|
||||
Reference in New Issue
Block a user