Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
commit
eab5f47203
@ -85,12 +85,12 @@ func main() {
|
|||||||
fs := http.FileServer(http.Dir(vueBuild))
|
fs := http.FileServer(http.Dir(vueBuild))
|
||||||
indexHtmlPath := vueBuild + "/index.html"
|
indexHtmlPath := vueBuild + "/index.html"
|
||||||
mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if strings.HasPrefix(r.URL.Path, "/api/") {
|
||||||
err := r.ParseMultipartForm(100 << 20)
|
err := r.ParseMultipartForm(100 << 20)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(r.URL.Path, "/api/") {
|
|
||||||
// 对/api开头的请求进行反向代理
|
// 对/api开头的请求进行反向代理
|
||||||
proxy := httputil.NewSingleHostReverseProxy(apiURL)
|
proxy := httputil.NewSingleHostReverseProxy(apiURL)
|
||||||
proxy.ServeHTTP(w, r)
|
proxy.ServeHTTP(w, r)
|
||||||
|
@ -41,6 +41,11 @@ func (l *UserRegisterLogic) UserRegister(req *types.RequestUserRegister, userinf
|
|||||||
return resp.SetStatus(basic.CodeOAuthEmailErr)
|
return resp.SetStatus(basic.CodeOAuthEmailErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_, err := l.svcCtx.AllModels.FsUser.FindUserByEmail(l.ctx, req.Email)
|
||||||
|
if err == nil {
|
||||||
|
return resp.SetStatus(basic.CodeEmailExistsErr)
|
||||||
|
}
|
||||||
|
|
||||||
token := &auth.RegisterToken{
|
token := &auth.RegisterToken{
|
||||||
OperateType: auth.OpTypeRegister,
|
OperateType: auth.OpTypeRegister,
|
||||||
GuestId: userinfo.GuestId,
|
GuestId: userinfo.GuestId,
|
||||||
|
@ -55,6 +55,7 @@ var (
|
|||||||
CodeEmailNotFoundErr = &StatusResponse{5050, "email not found"} // 未找到email
|
CodeEmailNotFoundErr = &StatusResponse{5050, "email not found"} // 未找到email
|
||||||
CodeUserIdNotFoundErr = &StatusResponse{5051, "user not found"} // 未找到用户
|
CodeUserIdNotFoundErr = &StatusResponse{5051, "user not found"} // 未找到用户
|
||||||
CodePasswordErr = &StatusResponse{5052, "invalid password"} // 无效密码
|
CodePasswordErr = &StatusResponse{5052, "invalid password"} // 无效密码
|
||||||
|
CodeEmailExistsErr = &StatusResponse{5053, "email exists"} // email存在
|
||||||
|
|
||||||
CodeSafeValueRangeErr = &StatusResponse{5040, "value not in range"} // 值不在范围内
|
CodeSafeValueRangeErr = &StatusResponse{5040, "value not in range"} // 值不在范围内
|
||||||
CodeTemplateErr = &StatusResponse{5040, "template parsed error"} // 模板解析错误
|
CodeTemplateErr = &StatusResponse{5040, "template parsed error"} // 模板解析错误
|
||||||
|
Loading…
x
Reference in New Issue
Block a user