mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
fix: improve code specification (#231)
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user