From 1ce9258c70ea695070826666e769bdbeddd5aef2 Mon Sep 17 00:00:00 2001 From: zhangkuo <769329489@qq.com> Date: Wed, 10 Jul 2024 18:46:43 +0800 Subject: [PATCH] login --- app/components/login.tsx | 4 ++-- app/constant.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/components/login.tsx b/app/components/login.tsx index 51ae53f16..dda7cf6bb 100644 --- a/app/components/login.tsx +++ b/app/components/login.tsx @@ -47,7 +47,7 @@ export function AuthPage() { const response = await fetch(url, { method: "POST", headers: { - "Content-Type": "application/x-www-form-urlencoded", + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", }, body: formData.toString(), }); @@ -62,7 +62,7 @@ export function AuthPage() { goChat(); // 导航到聊天页面或其他逻辑 } else { // 登录失败 - showToast(Locale.Login.LoginFail); + showToast(data.status.msg); } } catch (error) { console.error("API 请求失败", error); diff --git a/app/constant.ts b/app/constant.ts index c4a73c6b0..21b7d071e 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -18,11 +18,11 @@ export const BAIDU_BASE_URL = "https://aip.baidubce.com"; export const BAIDU_OATUH_URL = `${BAIDU_BASE_URL}/oauth/2.0/token`; -export const BASE_URL = `http://127.0.0.1:8080`; +export const BASE_URL = `https://buoucoding.com/ai`; export enum Login { - Register = "/login/register", - Login = "/login/username", + Register = "/register", + Login = "/login", } export enum Path {