diff --git a/src-tauri/src/commands/auth.rs b/src-tauri/src/commands/auth.rs index 95741fd..f054240 100644 --- a/src-tauri/src/commands/auth.rs +++ b/src-tauri/src/commands/auth.rs @@ -369,19 +369,19 @@ pub async fn oauth_exchange_code( let state_guard = state.read(); let client = &state_guard.http_client; - let params = [ - ("grant_type", "authorization_code"), - ("code", &code), - ("client_id", &platform_id), - ("client_secret", &platform_secret), - ("redirect_uri", &callback_url), - ]; + let payload = serde_json::json!({ + "grant_type": "authorization_code", + "code": &code, + "client_id": &platform_id, + "client_secret": &platform_secret, + "redirect_uri": &callback_url, + }); - println!("[OAuth] 请求参数:{:?}", params); + println!("[OAuth] 请求参数:{:?}", payload); let response = client - .post("https://sectl.top/api/oauth/token") - .form(¶ms) + .post("https://appwrite.sectl.top/api/oauth/token") + .json(&payload) .send() .await .map_err(|e| format!("Request failed: {}", e))?; @@ -426,7 +426,7 @@ pub async fn oauth_revoke_token( } let response = client - .post("https://sectl.top/api/oauth/revoke") + .post("https://appwrite.sectl.top/api/oauth/revoke") .json(&payload) .send() .await @@ -454,7 +454,7 @@ pub async fn oauth_introspect_token( let client = &state_guard.http_client; let response = client - .post("https://sectl.top/api/oauth/introspect") + .post("https://appwrite.sectl.top/api/oauth/introspect") .json(&serde_json::json!({ "token": token, "client_id": platform_id, @@ -489,7 +489,7 @@ pub async fn oauth_get_user_info( let client = &state_guard.http_client; let response = client - .get("https://sectl.top/api/oauth/userinfo") + .get("https://appwrite.sectl.top/api/oauth/userinfo") .header("Authorization", format!("Bearer {}", access_token)) .send() .await @@ -522,7 +522,7 @@ pub async fn oauth_refresh_token( let client = &state_guard.http_client; let response = client - .post("https://sectl.top/api/oauth/token") + .post("https://appwrite.sectl.top/api/oauth/token") .json(&serde_json::json!({ "grant_type": "refresh_token", "refresh_token": refresh_token, diff --git a/src/components/AutoScore/AutoScoreUtils.ts b/src/components/AutoScore/AutoScoreUtils.ts index efc45be..44bc56d 100644 --- a/src/components/AutoScore/AutoScoreUtils.ts +++ b/src/components/AutoScore/AutoScoreUtils.ts @@ -549,7 +549,11 @@ export const normalizeActionDrafts = (drafts: ActionDraft[] | null | undefined): export const actionsToDrafts = (actions: AutoScoreAction[]): ActionDraft[] => { const mapped = actions .map((action) => { - if (action.event !== "add_score" && action.event !== "add_tag" && action.event !== "settle_score") { + if ( + action.event !== "add_score" && + action.event !== "add_tag" && + action.event !== "settle_score" + ) { return null } return { diff --git a/src/components/AutoScore/IntervalValueWidget.tsx b/src/components/AutoScore/IntervalValueWidget.tsx index 76d82f2..65c08c3 100644 --- a/src/components/AutoScore/IntervalValueWidget.tsx +++ b/src/components/AutoScore/IntervalValueWidget.tsx @@ -27,11 +27,7 @@ const buildNextIntervalValue = ( const getDisplayValue = (value: number | undefined, fallback = 0) => typeof value === "number" && Number.isFinite(value) ? value : fallback -export const IntervalValueWidget: React.FC = ({ - value, - setValue, - readonly, -}) => { +export const IntervalValueWidget: React.FC = ({ value, setValue, readonly }) => { const { t } = useTranslation() const parsedValue = parseIntervalTriggerValue(value) diff --git a/src/components/AutoScoreManager.tsx b/src/components/AutoScoreManager.tsx index 76b81d3..75ac4b0 100644 --- a/src/components/AutoScoreManager.tsx +++ b/src/components/AutoScoreManager.tsx @@ -441,7 +441,7 @@ function AutoScoreManager({ canEdit }: AutoScoreManagerProps): React.JSX.Element } finally { setRollingBackBatchId(null) } - } + }, }) } @@ -620,7 +620,11 @@ function AutoScoreManager({ canEdit }: AutoScoreManagerProps): React.JSX.Element name="name" rules={[{ required: true, message: t("autoScore.nameRequired") }]} > - +