Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : 백엔드 API 연결 #29

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: 백엔드 API연결
JjungminLee committed Feb 21, 2024
commit 2648ed377ba938400fcbb9065066d212726a40bc
4 changes: 3 additions & 1 deletion src/Logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SetLocalStorage, SetLocalStorageClear } from './SetLocalStorage';
import { postLog } from './apis/postLog';
import { LogPayloadParams, ServiceNameType } from './types/LogType';
import CryptoJS from 'crypto-js';

@@ -95,6 +96,7 @@ window.addEventListener('unload', async (event) => {

const logList: any[] = JSON.parse(localStorage.getItem('yls-web') as string) || [];

// const res = await postLog(logList);
const res = await postLog(logList);
console.log(res);
SetLocalStorageClear();
});
4 changes: 2 additions & 2 deletions src/apis/postLog.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import customedAxios from './customedAxios';

export const postLog = async () => {
const res = await customedAxios.put('');
export const postLog = async (data: any) => {
const res = await customedAxios.put('/log/list', data);
return res.data;
};