MCPcopy Create free account
hub / github.com/FongMi/CatVodSpider / login

Method login

app/src/main/java/com/github/catvod/spider/AList.java:170–182  ·  view source on GitHub ↗
(Drive drive)

Source from the content-addressed store, hash-verified

168 }
169
170 private boolean login(Drive drive) {
171 try {
172 JSONObject params = new JSONObject();
173 params.put("username", drive.getLogin().getUsername());
174 params.put("password", drive.getLogin().getPassword());
175 String response = OkHttp.post(drive.loginApi(), params.toString());
176 drive.setToken(new JSONObject(response).getJSONObject("data").getString("token"));
177 return true;
178 } catch (Exception e) {
179 e.printStackTrace();
180 return false;
181 }
182 }
183
184 private Item getDetail(String id) {
185 try {

Callers 1

postMethod · 0.95

Calls 9

postMethod · 0.95
putMethod · 0.80
getUsernameMethod · 0.80
getLoginMethod · 0.80
getPasswordMethod · 0.80
loginApiMethod · 0.80
toStringMethod · 0.80
setTokenMethod · 0.80
getStringMethod · 0.80

Tested by

no test coverage detected