init
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React, { createContext, useContext, useEffect, useState } from 'react';
|
||||
import { API_BASE_URL } from '../config';
|
||||
|
||||
const AuthContext = createContext();
|
||||
|
||||
@@ -15,7 +16,7 @@ export function AuthProvider({ children }) {
|
||||
}, []);
|
||||
|
||||
const login = async (email, password) => {
|
||||
const res = await fetch('http://localhost:8010/auth/login', {
|
||||
const res = await fetch(`${API_BASE_URL}/auth/login`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
credentials: 'include',
|
||||
@@ -35,7 +36,7 @@ export function AuthProvider({ children }) {
|
||||
|
||||
const logout = async () => {
|
||||
try {
|
||||
await fetch('http://localhost:8010/auth/logout', { method: 'POST', credentials: 'include' });
|
||||
await fetch(`${API_BASE_URL}/auth/logout`, { method: 'POST', credentials: 'include' });
|
||||
} catch {}
|
||||
setUser(null);
|
||||
try { localStorage.removeItem('auth_user'); } catch {}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React, { createContext, useState, useContext, useEffect } from 'react';
|
||||
import { API_BASE_URL } from '../config';
|
||||
|
||||
const ToolContext = createContext();
|
||||
|
||||
@@ -16,7 +17,7 @@ export function ToolProvider({ children }) {
|
||||
useEffect(() => {
|
||||
async function load() {
|
||||
try {
|
||||
const res = await fetch('http://localhost:8010/tools');
|
||||
const res = await fetch(`${API_BASE_URL}/tools`);
|
||||
const data = await res.json();
|
||||
// 'GxP 챗봇'과 'chatgpt' 카드는 도구 목록에서 제거
|
||||
const filtered = (Array.isArray(data) ? data : []).filter((tool) => !['chatbot_gxp','chatgpt'].includes(tool.id));
|
||||
|
||||
Reference in New Issue
Block a user