liuxiaolong
2019-07-04 0aca22f3cef923ebe6b2e3d3136e7057cecb2056
fix tip bug
3个文件已修改
14 ■■■■■ 已修改文件
controllers/area.go 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/user.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
extend/code/code.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/area.go
@@ -72,9 +72,9 @@
    }
    paramBody := util.Struct2Map(model)
    if api.AreaAdd(paramBody) {
        util.ResponseFormat(c,code.Success,"保存成功")
        util.ResponseFormat(c,code.AddSuccess,"添加成功")
    } else {
        util.ResponseFormat(c,code.ComError,"保存失败")
        util.ResponseFormat(c,code.ComError,"添加失败")
    }
}
@@ -109,7 +109,7 @@
    paramBody := util.Struct2Map(model)
    var api dbapi.AreaApi
    if api.AreaUpdate(paramBody) {
        util.ResponseFormat(c,code.Success,"更新成功")
        util.ResponseFormat(c,code.UpdateSuccess,"更新成功")
    }else {
        util.ResponseFormat(c,code.ComError,"更新失败")
    }
@@ -133,7 +133,7 @@
    }
    if api.AreaDelete(areaId) {
        util.ResponseFormat(c, code.Success, "删除成功")
        util.ResponseFormat(c, code.DelSuccess, "删除成功")
    } else {
        util.ResponseFormat(c, code.ComError,"删除失败")
    }
controllers/user.go
@@ -39,7 +39,7 @@
    if flag {
        authDriver := auth.GenerateAuthDriver()
        tokenStr := (*authDriver).Login(c.Request, c.Writer, util.Struct2Map(userInfo))
        util.ResponseFormat(c,code.Success,map[string]interface{}{
        util.ResponseFormat(c,code.LoginSuccess,map[string]interface{}{
            "userInfo":userInfo,
            "access_token":tokenStr,
            "refresh_token":tokenStr,
extend/code/code.go
@@ -12,6 +12,9 @@
var (
    // Success 请求处理成功
    Success = &Code{http.StatusOK, true, "请求处理成功"}
    AddSuccess = &Code{http.StatusOK,true,"添加成功"}
    UpdateSuccess = &Code{http.StatusOK,true,"更新成功"}
    DelSuccess = &Code{http.StatusOK,true,"删除成功"}
    // RequestParamError 请求参数错误
    RequestParamError = &Code{http.StatusBadRequest, false, "请求参数有误"}
    // AccountPassUnmatch 该账号原密码不匹配
@@ -24,6 +27,7 @@
    UploadSuffixError = &Code{http.StatusBadRequest, false, "该上传文件格式目前暂不支持"}
    // UploadSizeLimit 目前上传仅支持小于5M的文件内容
    UploadSizeLimit = &Code{http.StatusBadRequest, false, "目前上传仅支持小于5M的文件内容"}
    LoginSuccess = &Code{http.StatusOK,true,"登录成功"}
    // SigninInfoError 账户名或密码有误
    SigninInfoError = &Code{http.StatusUnauthorized, false, "账户名或密码有误"}
    // TokenNotFound 请求未携带Token, 无权访问