mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-10-10 04:53:09 +08:00
4c39bbe9c2
QR code scans were authorized on the phone but the storage stayed stuck on the QR page, and token-only setups failed with "params is null". The driver used appId 8025431004 while the official PC client uses 9317140619. Tokens, sessions and QR sessions are all scoped to an appId, so the mismatch meant the QR poll never saw status:0 and an accessToken could not be exchanged for a sessionSecret. - Use appId 9317140619 and version 7.2.4.0. QR state polling uses clientType=1; password login keeps 10020. - Send the QR poll parameters the official client sends (cb_SaveName, isOauth2, state, user-finger header, logbox Referer) and poll locally instead of only checking once per save. - Parse lt/reqId from the logbox redirect and paramId from appConf.do. The new login page no longer embeds them as inline variables; the old inline format is still supported. - Implement the -133 second device verification via sendSmsCodeForSecondAuth/submitForSecondAuth. That endpoint has no dedicated SMS field: the code goes into epd, encrypted with the same public key used for the password. Persist the DEVICEID cookie so the verification only happens once. - Detect refreshToken.do failures. It reports them as HTTP 200 with a result field, so SetError never fired and a failed refresh was treated as success, surfacing later as a misleading "params is null". - username/password are no longer required, so token-only storages save without placeholders. clientSn/jgOpenId are optional and only sent when configured; user-finger is generated once per storage. - Return named errors instead of panicking when the login page changes shape. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
44 lines
2.3 KiB
Go
44 lines
2.3 KiB
Go
package _189pc
|
|
|
|
import (
|
|
"github.com/OpenListTeam/OpenList/v4/internal/driver"
|
|
"github.com/OpenListTeam/OpenList/v4/internal/op"
|
|
)
|
|
|
|
type Addition struct {
|
|
LoginType string `json:"login_type" type:"select" options:"password,qrcode" default:"password" required:"true"`
|
|
Username string `json:"username" help:"Not needed when an access token or refresh token is provided"`
|
|
Password string `json:"password" help:"Not needed when an access token or refresh token is provided"`
|
|
VCode string `json:"validate_code"`
|
|
SmsCode string `json:"sms_code" help:"SMS code for the second device verification, fill it in and save again when login asks for it"`
|
|
AccessToken string `json:"access_token" required:"false"`
|
|
RefreshToken string `json:"refresh_token" help:"To switch accounts, please clear this field"`
|
|
DeviceID string `json:"device_id" help:"DEVICEID cookie issued after the second device verification, keep it to avoid verifying again"`
|
|
ClientSn string `json:"client_sn" help:"Device serial number captured from the official client, leave it empty if you do not have one"`
|
|
JgOpenId string `json:"jg_open_id" help:"Optional push id reported by the official client"`
|
|
UserFinger string `json:"user_finger" help:"Device fingerprint sent with login requests, generated and kept automatically when empty"`
|
|
driver.RootID
|
|
OrderBy string `json:"order_by" type:"select" options:"filename,filesize,lastOpTime" default:"filename"`
|
|
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
|
|
Type string `json:"type" type:"select" options:"personal,family" default:"personal"`
|
|
FamilyID string `json:"family_id"`
|
|
UploadMethod string `json:"upload_method" type:"select" options:"stream,rapid,old" default:"stream"`
|
|
UploadThread string `json:"upload_thread" default:"3" help:"1<=thread<=32"`
|
|
FamilyTransfer bool `json:"family_transfer"`
|
|
RapidUpload bool `json:"rapid_upload"`
|
|
NoUseOcr bool `json:"no_use_ocr"`
|
|
GenerateTorrent bool `json:"generate_torrent" help:"Generate torrent file with CAS extension after upload"`
|
|
}
|
|
|
|
var config = driver.Config{
|
|
Name: "189CloudPC",
|
|
DefaultRoot: "-11",
|
|
CheckStatus: true,
|
|
}
|
|
|
|
func init() {
|
|
op.RegisterDriver(func() driver.Driver {
|
|
return &Cloud189PC{}
|
|
})
|
|
}
|