This repository has been archived by the owner on Nov 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/com/xtaolabs/gcauth_oauth/handler/JsonHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.xtaolabs.gcauth_oauth.handler; | ||
|
||
import java.io.IOException; | ||
|
||
import express.http.HttpContextHandler; | ||
import express.http.Request; | ||
import express.http.Response; | ||
|
||
|
||
public final class JsonHandler implements HttpContextHandler { | ||
@Override | ||
public void handle(Request req, Response res) throws IOException { | ||
String Login_Html_Url = "https://account.mihoyo.com/gcauth_oauth/login.html"; | ||
res.set("server", "tsa_m"); | ||
res.set("Content-Type", "application/json; charset=utf-8"); | ||
res.set("access-control-allow-credentials", "true"); | ||
res.set("access-control-allow-origin", "https://account.hoyoverse.com"); | ||
res.send(String.format("{\"code\":200,\"data\":{\"auth_url\":\"%s\",\"info\":\"\",\"msg\":\"Success\",\"status\":1}}", | ||
Login_Html_Url)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters