重新初始化项目

This commit is contained in:
2023-04-27 15:56:12 +08:00
parent 10546eb629
commit d6e256ef9e
50 changed files with 1255 additions and 308 deletions

View File

@@ -32,6 +32,7 @@ func (u userApi) GetUser(ctx *gin.Context) {
// 转换为VO
var v vo.UserVO
v.ParseOrdinary(ue)
core.R(ctx).OkWithData(v)
}
@@ -56,11 +57,11 @@ func (u userApi) BindingWeChat(ctx *gin.Context) {
core.R(ctx).FailWithMessage("系统错误,请稍后再试")
return
}
log.Debugf("用户[%v]的UnionId为[%v]OpenId为[%v]", loginUser.Id, unionId, openId)
if repository.User().CheckUnionIdIsExist(unionId, openId) {
core.R(ctx).FailWithMessage("该微信已绑定其他账号")
return
}
//log.Debugf("用户[%v]的UnionId为[%v]OpenId为[%v]", loginUser.Id, unionId, openId)
//if repository.User().CheckUnionIdIsExist(unionId, openId) {
// core.R(ctx).FailWithMessage("该微信已绑定其他账号")
// return
//}
// 解析成功,修改用户信息
loginUser.WechatUnionId = &unionId
loginUser.WechatOpenId = &openId
@@ -100,5 +101,6 @@ func (u userApi) UpdateUser(ctx *gin.Context) {
core.R(ctx).FailWithMessage("修改用户信息失败: " + err.Error())
return
}
// 操作成功,更新头像和昵称
core.R(ctx).Ok()
}