Skip to content

想给那些没有移动端页面但是需要登录的书源写个登录UI,请问该怎么写? #3075

Answered by daiaji
daiaji asked this question in Q&A
Discussion options

You must be logged in to vote

用java.ajax吧,估计是被检测到了一些指纹特征

@js:
function login() {
	une = source.getLoginInfoMap().get("账号")
	pwd = source.getLoginInfoMap().get("密码")

	if (une && pwd) {
		let body = JSON.stringify({
			"is_encrypted": 0,
			"platform": "pc",
			"client": "web",
			"sign": "",
			"gz": 0,
			"d": {
				"username": String(une),
				"password": String(pwd)
			}
		})
		let url = source.bookSourceUrl + 'proxy/api/user/login'
		ck = java.post(url, body, { "Content-Type": "application/json","user-agent":"Dart/2.10 (dart:io)" }).cookies()

		header = JSON.stringify({
			"Cookie": String(ck).match(/\{(.*?)\}/)[1].replace(/,/g, ';')
		})
		source.putLoginHeader(header)
	}
}

抓包获得了意外的进展。
如果使用"user-agent":"Dart/…

Replies: 1 comment 35 replies

Comment options

You must be logged in to vote
35 replies
@daiaji
Comment options

@821938089
Comment options

@daiaji
Comment options

@daiaji
Comment options

Answer selected by daiaji
@daiaji
Comment options

@821938089
Comment options

@daiaji
Comment options

@821938089
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants