mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 21:14:21 +08:00
FEAT: sectl.top->sectl.cn
This commit is contained in:
@@ -444,7 +444,7 @@ pub async fn oauth_get_authorization_url(
|
|||||||
let code_challenge = generate_code_challenge(&code_verifier);
|
let code_challenge = generate_code_challenge(&code_verifier);
|
||||||
|
|
||||||
let url = format!(
|
let url = format!(
|
||||||
"https://sectl.top/oauth/authorize?client_id={}&redirect_uri={}&response_type=code&state={}&code_challenge={}&code_challenge_method=S256",
|
"https://sectl.cn/oauth/authorize?client_id={}&redirect_uri={}&response_type=code&state={}&code_challenge={}&code_challenge_method=S256",
|
||||||
platform_id,
|
platform_id,
|
||||||
urlencoding::encode(&callback_url),
|
urlencoding::encode(&callback_url),
|
||||||
urlencoding::encode(&state),
|
urlencoding::encode(&state),
|
||||||
@@ -490,7 +490,7 @@ pub async fn oauth_exchange_code(
|
|||||||
println!("[OAuth] 请求参数:{:?}", payload);
|
println!("[OAuth] 请求参数:{:?}", payload);
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.post("https://appwrite.sectl.top/api/oauth/token")
|
.post("https://appwrite.sectl.cn/api/oauth/token")
|
||||||
.json(&payload)
|
.json(&payload)
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
@@ -547,7 +547,7 @@ pub async fn oauth_revoke_token(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.post("https://appwrite.sectl.top/api/oauth/revoke")
|
.post("https://appwrite.sectl.cn/api/oauth/revoke")
|
||||||
.json(&payload)
|
.json(&payload)
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
@@ -574,7 +574,7 @@ pub async fn oauth_introspect_token(
|
|||||||
let client = &state_guard.http_client;
|
let client = &state_guard.http_client;
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.post("https://appwrite.sectl.top/api/oauth/introspect")
|
.post("https://appwrite.sectl.cn/api/oauth/introspect")
|
||||||
.json(&serde_json::json!({
|
.json(&serde_json::json!({
|
||||||
"token": token,
|
"token": token,
|
||||||
"client_id": platform_id,
|
"client_id": platform_id,
|
||||||
@@ -613,7 +613,7 @@ pub async fn oauth_get_user_info(
|
|||||||
let client = &state_guard.http_client;
|
let client = &state_guard.http_client;
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.get("https://appwrite.sectl.top/api/oauth/userinfo")
|
.get("https://appwrite.sectl.cn/api/oauth/userinfo")
|
||||||
.header("Authorization", format!("Bearer {}", access_token))
|
.header("Authorization", format!("Bearer {}", access_token))
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
@@ -664,7 +664,7 @@ pub async fn oauth_refresh_token(
|
|||||||
let client = &state_guard.http_client;
|
let client = &state_guard.http_client;
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.post("https://appwrite.sectl.top/api/oauth/token")
|
.post("https://appwrite.sectl.cn/api/oauth/token")
|
||||||
.json(&serde_json::json!({
|
.json(&serde_json::json!({
|
||||||
"grant_type": "refresh_token",
|
"grant_type": "refresh_token",
|
||||||
"refresh_token": refresh_token,
|
"refresh_token": refresh_token,
|
||||||
@@ -719,7 +719,7 @@ pub async fn oauth_get_storage_usage(
|
|||||||
let client = &state_guard.http_client;
|
let client = &state_guard.http_client;
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.get("https://appwrite.sectl.top/api/cloud/storage/usage")
|
.get("https://appwrite.sectl.cn/api/cloud/storage/usage")
|
||||||
.query(&[("client_id", platform_id), ("user_id", user_id)])
|
.query(&[("client_id", platform_id), ("user_id", user_id)])
|
||||||
.header("Authorization", format!("Bearer {}", access_token))
|
.header("Authorization", format!("Bearer {}", access_token))
|
||||||
.send()
|
.send()
|
||||||
@@ -787,7 +787,7 @@ pub async fn oauth_report_online(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.post("https://appwrite.sectl.top/api/stats/online")
|
.post("https://appwrite.sectl.cn/api/stats/online")
|
||||||
.json(&payload)
|
.json(&payload)
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
@@ -911,7 +911,7 @@ pub async fn oauth_refresh_access_token(
|
|||||||
println!("[OAuth] 刷新 token 请求参数: {:?}", payload);
|
println!("[OAuth] 刷新 token 请求参数: {:?}", payload);
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.post("https://appwrite.sectl.top/api/oauth/token")
|
.post("https://appwrite.sectl.cn/api/oauth/token")
|
||||||
.json(&payload)
|
.json(&payload)
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import CryptoJS from "crypto-js"
|
|||||||
|
|
||||||
// SECTL API 配置
|
// SECTL API 配置
|
||||||
export const SECTL_CONFIG = {
|
export const SECTL_CONFIG = {
|
||||||
baseUrl: "https://appwrite.sectl.top",
|
baseUrl: "https://appwrite.sectl.cn",
|
||||||
authUrl: "https://sectl.top",
|
authUrl: "https://sectl.cn",
|
||||||
platformId: "", // 需要在设置中配置
|
platformId: "", // 需要在设置中配置
|
||||||
callbackUrl: "http://localhost:5173/auth/callback",
|
callbackUrl: "http://localhost:5173/auth/callback",
|
||||||
callbackPort: 5173,
|
callbackPort: 5173,
|
||||||
|
|||||||
Reference in New Issue
Block a user