Rename to authState, useProxy, delete EnableDocs.

This commit is contained in:
Yang Luo 2021-05-09 11:55:43 +08:00
parent aa706019f2
commit 5a3abdbc95
4 changed files with 6 additions and 7 deletions

View File

@ -6,9 +6,8 @@ copyrequestbody = true
driverName = mysql
dataSourceName = root:123@tcp(localhost:3306)/
dbName = casdoor
AuthState = "casdoor"
UseProxy = false
EnableDocs = true
authState = "casdoor"
useProxy = false
mailUser = ""
mailPass = ""
mailHost = ""

View File

@ -190,7 +190,7 @@ func (c *ApiController) UploadAvatar() {
}
dist, _ := base64.StdEncoding.DecodeString(avatarBase64[index+1:])
msg := object.UploadAvatar(user.Owner + "/" + user.Name, dist)
msg := object.UploadAvatar(user.GetId(), dist)
if msg != "" {
resp = Response{Status: "error", Msg: msg}
c.Data["json"] = resp

View File

@ -121,8 +121,8 @@ func (c *ApiController) Login() {
idProvider := idp.GetIdProvider(provider.Type, provider.ClientId, provider.ClientSecret, form.RedirectUri)
idProvider.SetHttpClient(httpClient)
if form.State != beego.AppConfig.String("AuthState") && form.State != application.Name {
resp = &Response{Status: "error", Msg: fmt.Sprintf("state expected: \"%s\", but got: \"%s\"", beego.AppConfig.String("AuthState"), form.State)}
if form.State != beego.AppConfig.String("authState") && form.State != application.Name {
resp = &Response{Status: "error", Msg: fmt.Sprintf("state expected: \"%s\", but got: \"%s\"", beego.AppConfig.String("authState"), form.State)}
c.Data["json"] = resp
c.ServeJSON()
return

View File

@ -24,7 +24,7 @@ import (
var httpClient *http.Client
func InitHttpClient() {
useProxy, err := beego.AppConfig.Bool("UseProxy")
useProxy, err := beego.AppConfig.Bool("useProxy")
if err != nil {
panic(err)
}