🎨 Support LiuYun account login https://github.com/siyuan-note/siyuan/issues/8578
This commit is contained in:
parent
1bf19f7967
commit
ab5a91de5c
2 changed files with 7 additions and 3 deletions
|
@ -95,7 +95,8 @@ func login(c *gin.Context) {
|
|||
name := arg["userName"].(string)
|
||||
password := arg["userPassword"].(string)
|
||||
captcha := arg["captcha"].(string)
|
||||
result, err := model.Login(name, password, captcha)
|
||||
cloudRegion := int(arg["cloudRegion"].(float64))
|
||||
result, err := model.Login(name, password, captcha, cloudRegion)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -564,13 +564,16 @@ func CheckActivationcode(code string) (retCode int, msg string) {
|
|||
return
|
||||
}
|
||||
|
||||
func Login(userName, password, captcha string) (ret *gulu.Result, err error) {
|
||||
func Login(userName, password, captcha string, cloudRegion int) (ret *gulu.Result, err error) {
|
||||
Conf.CloudRegion = cloudRegion
|
||||
Conf.Save()
|
||||
|
||||
result := map[string]interface{}{}
|
||||
request := httpclient.NewCloudRequest30s()
|
||||
_, err = request.
|
||||
SetSuccessResult(&result).
|
||||
SetBody(map[string]string{"userName": userName, "userPassword": password, "captcha": captcha}).
|
||||
Post(util.ChinaServer + "/apis/siyuan/login")
|
||||
Post(getCloudServer() + "/apis/siyuan/login")
|
||||
if nil != err {
|
||||
logging.LogErrorf("login failed: %s", err)
|
||||
return nil, errors.New(Conf.Language(18))
|
||||
|
|
Loading…
Add table
Reference in a new issue