|
@@ -0,0 +1,27 @@
|
|
|
+export async function initLogin() {
|
|
|
+ const f = new FormData();
|
|
|
+ f.append("loginType", "mark-login");
|
|
|
+ f.append("loginName", "1-431-2-1");
|
|
|
+ f.append("password", "123456");
|
|
|
+
|
|
|
+ return fetch("/login", { body: f, method: "POST" })
|
|
|
+ .then(async (r) => console.log(r))
|
|
|
+ .then(() => {
|
|
|
+ const f = new FormData();
|
|
|
+ f.append("examId", "1");
|
|
|
+ f.append("markerId", "367");
|
|
|
+
|
|
|
+ return fetch("/mark/subject-select", { body: f, method: "POST" });
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ console.log("login completed");
|
|
|
+ return fetch("/mark/status");
|
|
|
+ })
|
|
|
+ .then(async (r) => {
|
|
|
+ console.log(await r.json());
|
|
|
+ return fetch("/mark/gettask");
|
|
|
+ })
|
|
|
+ .then(async (r) => {
|
|
|
+ console.log(await r.json());
|
|
|
+ });
|
|
|
+}
|