fix: improve code specification (#231)

This commit is contained in:
sh1luo
2021-08-07 22:02:56 +08:00
committed by Yang Luo
parent a271ef0719
commit 8c66ef6860
36 changed files with 209 additions and 164 deletions

View File

@ -50,15 +50,15 @@ func getUserByClientIdSecret(ctx *context.Context) string {
if app == nil || app.ClientSecret != clientSecret {
return ""
}
return app.Organization+"/"+app.Name
return app.Organization + "/" + app.Name
}
func RecordMessage(ctx *context.Context) {
if ctx.Request.URL.Path != "/api/login" {
user := getUser(ctx)
userinfo := strings.Split(user,"/")
userinfo := strings.Split(user, "/")
if user == "" {
userinfo = append(userinfo,"")
userinfo = append(userinfo, "")
}
record := util.Records(ctx)
record.Organization = userinfo[0]
@ -67,4 +67,3 @@ func RecordMessage(ctx *context.Context) {
object.AddRecord(record)
}
}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// Package routers
// @APIVersion 1.0.0
// @Title Casdoor API
// @Description Documentation of Casdoor API
@ -99,4 +100,3 @@ func initAPI() {
beego.Router("/api/send-email", &controllers.ApiController{}, "POST:SendEmail")
beego.Router("/api/send-sms", &controllers.ApiController{}, "POST:SendSms")
}