优化uniapp
This commit is contained in:
1 parent
4f1acaa451
commit
8fc52c574f
49 files changed
+1952
-197
No files matched your search
@@ -436,8 +436,20 @@ func SearchTenantsForRegister(keyword string) ([]TenantSearchItem, error) {
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// JoinApplyDetail 小程序「挂靠企业」补充资料。
|
||||
// 手机号不允许前端传:统一由后端从身份表读取微信验证过的手机号。
|
||||
type JoinApplyDetail struct {
|
||||
ApplicantName string
|
||||
DepartmentID uint64
|
||||
DepartmentName string
|
||||
PositionID uint64
|
||||
PositionName string
|
||||
WechatMobile string
|
||||
}
|
||||
|
||||
// CreateJoinApply 「绑定企业」申请:等待目标企业管理员审批
|
||||
func CreateJoinApply(identityID, tid uint64) (*models.AuthTenantApply, error) {
|
||||
// detail 为可选参数,PC 两步式注册沿用原调用(不传),小程序挂靠表单传入补充资料。
|
||||
func CreateJoinApply(identityID, tid uint64, detail ...JoinApplyDetail) (*models.AuthTenantApply, error) {
|
||||
if identityID == 0 || tid == 0 {
|
||||
return nil, errors.New("参数错误")
|
||||
}
|
||||
@@ -477,7 +489,22 @@ func CreateJoinApply(identityID, tid uint64) (*models.AuthTenantApply, error) {
|
||||
TenantName: tenant.TenantName,
|
||||
Status: models.TenantApplyStatusPending,
|
||||
}
|
||||
apply.ContactPerson = identityNickname(identity)
|
||||
// 小程序挂靠表单:补充姓名 / 部门 / 职位,手机号取微信验证过的身份手机号
|
||||
if len(detail) > 0 {
|
||||
d := detail[0]
|
||||
apply.ApplicantName = strings.TrimSpace(d.ApplicantName)
|
||||
apply.DepartmentID = d.DepartmentID
|
||||
apply.DepartmentName = strings.TrimSpace(d.DepartmentName)
|
||||
apply.PositionID = d.PositionID
|
||||
apply.PositionName = strings.TrimSpace(d.PositionName)
|
||||
apply.WechatMobile = strings.TrimSpace(d.WechatMobile)
|
||||
if apply.ApplicantName != "" {
|
||||
apply.ContactPerson = apply.ApplicantName
|
||||
}
|
||||
}
|
||||
if apply.ContactPerson == "" {
|
||||
apply.ContactPerson = identityNickname(identity)
|
||||
}
|
||||
if identity.Mobile != nil {
|
||||
apply.ContactPhone = *identity.Mobile
|
||||
}
|
||||
@@ -622,6 +649,13 @@ func ApproveJoinApply(applyID, tid, reviewerID uint64, reviewerName string) erro
|
||||
if err := bindIdentityToTenant(identity, tid, models.GetTenantUserRole); err != nil {
|
||||
return err
|
||||
}
|
||||
// 挂靠申请选了部门:审批通过后把 org_id 落到认证中心绑定行
|
||||
if apply.DepartmentID > 0 {
|
||||
_, _ = models.Orm.QueryTable(new(models.AuthTenantUser)).
|
||||
Filter("tid", tid).
|
||||
Filter("identity_id", apply.IdentityID).
|
||||
Update(map[string]interface{}{"org_id": apply.DepartmentID, "update_time": time.Now()})
|
||||
}
|
||||
return finishApply(apply, models.TenantApplyStatusPassed, "", reviewerID, reviewerName)
|
||||
}
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ func (s *WechatMpSender) Send(ctx context.Context, reminder ReminderData, title,
|
||||
perr := wechatmp.PushToOpenID(cfg, openid, wechatmp.PushMessage{
|
||||
Title: title,
|
||||
Content: content,
|
||||
Remark: "来自云泽管理平台日程提醒",
|
||||
Remark: "来自温新云平台日程提醒",
|
||||
})
|
||||
if perr != nil {
|
||||
return false, perr
|
||||
|
||||
@@ -46,6 +46,8 @@ func (e *APIError) Explain() string {
|
||||
return "AppID 无效:请核对小程序后台「开发 → 开发管理」中的 AppID"
|
||||
case 40125:
|
||||
return "AppSecret 错误:请在小程序后台重置后复制新的 AppSecret 填入本页"
|
||||
case 40164, 61004:
|
||||
return "服务器出口 IP 不在白名单:请在小程序后台「开发管理 → 开发设置 → IP白名单」加入本服务器出口 IP"
|
||||
case 40226:
|
||||
return "该小程序未开通手机号快速验证能力:请在「开发管理 → 接口设置」中开通"
|
||||
case 45009:
|
||||
|
||||
Reference in new issue
Block a user