mirror of
https://github.com/baiqwerdvd/ArknightsUID.git
synced 2025-05-05 03:23:45 +08:00
update
This commit is contained in:
parent
3b0956f743
commit
d836d7dd8d
@ -116,19 +116,22 @@ class SklandLogin:
|
|||||||
return result.msg
|
return result.msg
|
||||||
|
|
||||||
def token_by_phone_code(self, code: str):
|
def token_by_phone_code(self, code: str):
|
||||||
data = UserAuthV2TokenByPhoneCodeRequest(
|
# data = UserAuthV2TokenByPhoneCodeRequest(
|
||||||
phone=self.phone,
|
# phone=self.phone,
|
||||||
code=code,
|
# code=code,
|
||||||
)
|
# )
|
||||||
data = {
|
# data = {
|
||||||
"phone": self.phone,
|
# "phone": self.phone,
|
||||||
"code": code,
|
# "code": code,
|
||||||
}
|
# }
|
||||||
data = mscjson.decode(mscjson.encode(data))
|
# data = mscjson.decode(mscjson.encode(data))
|
||||||
print(data)
|
# print(data)
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
ARK_TOKEN_BY_PHONE_CODE,
|
ARK_TOKEN_BY_PHONE_CODE,
|
||||||
json=data,
|
json={
|
||||||
|
"phone": self.phone,
|
||||||
|
"code": code,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
result = convert(response.json(), UserAuthV2TokenByPhoneCodeResponse)
|
result = convert(response.json(), UserAuthV2TokenByPhoneCodeResponse)
|
||||||
@ -181,15 +184,15 @@ class SklandLogin:
|
|||||||
raise SklandLoginError(ARK_ACCONUT_INFO_HG, result.msg)
|
raise SklandLoginError(ARK_ACCONUT_INFO_HG, result.msg)
|
||||||
|
|
||||||
def user_oauth2_v2_grant(self):
|
def user_oauth2_v2_grant(self):
|
||||||
data = Oauth2V2GrantRequest(
|
# data = Oauth2V2GrantRequest(
|
||||||
token=self.token,
|
# token=self.token,
|
||||||
appCode="4ca99fa6b56cc2ba",
|
# appCode="4ca99fa6b56cc2ba",
|
||||||
type=0,
|
# type=0,
|
||||||
)
|
# )
|
||||||
self.client.headers["dId"] = get_d_id()
|
# self.client.headers["dId"] = get_d_id()
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
ARK_USER_OAUTH2_V2_GRANT,
|
ARK_USER_OAUTH2_V2_GRANT,
|
||||||
json=mscjson.decode(mscjson.encode(data)),
|
json={"appCode": "4ca99fa6b56cc2ba", "token": self.token, "type": 0},
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
result = convert(response.json(), Oauth2V2GrantResponse)
|
result = convert(response.json(), Oauth2V2GrantResponse)
|
||||||
@ -209,17 +212,13 @@ class SklandLogin:
|
|||||||
self.code = code
|
self.code = code
|
||||||
|
|
||||||
def generate_cred_by_code(self):
|
def generate_cred_by_code(self):
|
||||||
data = ZonaiSklandWebUserGenerateCredByCodeRequest(
|
|
||||||
kind=1,
|
|
||||||
code=self.code,
|
|
||||||
)
|
|
||||||
self.client.headers["platform"] = "3"
|
self.client.headers["platform"] = "3"
|
||||||
self.client.headers["vName"] = "1.0.0"
|
self.client.headers["vName"] = "1.0.0"
|
||||||
self.client.headers["timestamp"] = str(int(datetime.now().timestamp()))
|
self.client.headers["timestamp"] = str(int(datetime.now().timestamp()))
|
||||||
self.client.headers["dId"] = get_d_id()
|
self.client.headers["dId"] = get_d_id()
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
GENERATE_CRED_BY_CODE,
|
GENERATE_CRED_BY_CODE,
|
||||||
json=json.dumps(mscjson.decode(mscjson.encode(data))),
|
json={"code": self.code, "kind": 1},
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
print(response.json())
|
print(response.json())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user