Skip to content

Commit

Permalink
chore: host 변수 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
jellyyelly committed Oct 24, 2024
1 parent 3947a9f commit fe727be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import "../app.css";
import { onMount } from "svelte";
import { auth } from '../stores/auth.js'
import { host } from '../stores/api.js';
import Header from '../components/Header.svelte';
let isLoggedIn = false;
Expand All @@ -10,7 +11,6 @@
}
onMount(async () => {
console.log('im layout')
await auth.checkLoginStatus()
});
</script>
Expand All @@ -19,7 +19,7 @@
<Header />
{#if isLoggedIn}
<div class="btn-box">
<form method="POST" action="/api/v1/admin/logout">
<form method="POST" action={host + "/api/v1/admin/logout"}>
<button class="btn-logout" type="submit">
로그아웃
</button>
Expand Down
4 changes: 3 additions & 1 deletion src/routes/login/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script>
import { host } from '../../stores/api.js';
const data = {
username: '',
password: ''
Expand All @@ -10,7 +12,7 @@
</script>

<div class="flex justify-center items-center mt-64">
<form class="flex-col" method="POST" action="/api/v1/admin/login">
<form class="flex-col" method="POST" action={host + "/api/v1/admin/login"}>
<div class="login-form-input-container">
<span class="login-form-label">아이디</span>
<input name="username" bind:value={data.username} class="login-input-field" type="text" required
Expand Down
7 changes: 5 additions & 2 deletions src/stores/api.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import axios from "axios";

export const host = "https://admin.upup-radio.site";
// export const host = "http://localhost:8090";

const send = async ({
method = "",
path = "",
data = {},
access_token = "",
} = {}) => {
const commonUrl = "https://admin.upup-radio.site";
const url = commonUrl + path;
console.log('zz', host)
const url = host + path;

const headers = {
"content-type": "application/json;charset=UTF-8",
Expand Down

0 comments on commit fe727be

Please sign in to comment.