Skip to content

Commit

Permalink
Fix getLdaps() GET
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz committed Feb 18, 2023
1 parent 3a70f4e commit 3ae8171
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions controllers/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (c *ApiController) GetLdapUser() {
// GetLdaps
// @Tag Account API
// @Title GetLdaps
// @router /get-ldaps [post]
// @router /get-ldaps [get]
func (c *ApiController) GetLdaps() {
owner := c.Input().Get("owner")

Expand All @@ -115,7 +115,7 @@ func (c *ApiController) GetLdaps() {
// GetLdap
// @Tag Account API
// @Title GetLdap
// @router /get-ldap [post]
// @router /get-ldap [get]
func (c *ApiController) GetLdap() {
id := c.Input().Get("id")

Expand Down
4 changes: 2 additions & 2 deletions routers/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ func initAPI() {
beego.Router("/api/get-captcha", &controllers.ApiController{}, "GET:GetCaptcha")

beego.Router("/api/get-ldap-user", &controllers.ApiController{}, "POST:GetLdapUser")
beego.Router("/api/get-ldaps", &controllers.ApiController{}, "POST:GetLdaps")
beego.Router("/api/get-ldap", &controllers.ApiController{}, "POST:GetLdap")
beego.Router("/api/get-ldaps", &controllers.ApiController{}, "GET:GetLdaps")
beego.Router("/api/get-ldap", &controllers.ApiController{}, "GET:GetLdap")
beego.Router("/api/add-ldap", &controllers.ApiController{}, "POST:AddLdap")
beego.Router("/api/update-ldap", &controllers.ApiController{}, "POST:UpdateLdap")
beego.Router("/api/delete-ldap", &controllers.ApiController{}, "POST:DeleteLdap")
Expand Down
4 changes: 2 additions & 2 deletions web/src/backend/LdapBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as Setting from "../Setting";

export function getLdaps(owner) {
return fetch(`${Setting.ServerUrl}/api/get-ldaps?owner=${owner}`, {
method: "POST",
method: "GET",
credentials: "include",
headers: {
"Accept-Language": Setting.getAcceptLanguage(),
Expand All @@ -26,7 +26,7 @@ export function getLdaps(owner) {

export function getLdap(id) {
return fetch(`${Setting.ServerUrl}/api/get-ldap?id=${id}`, {
method: "POST",
method: "GET",
credentials: "include",
headers: {
"Accept-Language": Setting.getAcceptLanguage(),
Expand Down

0 comments on commit 3ae8171

Please sign in to comment.