修改配置
This commit is contained in:
parent
bce01535dd
commit
c9df251998
@ -2,4 +2,4 @@ FROM alpine:latest
|
||||
|
||||
RUN sed -i 's@dl-cdn.alpinelinux.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apk/repositories \
|
||||
&& apk add --no-cache nginx
|
||||
CMD ["nginx"]
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
@ -7,7 +7,8 @@ services:
|
||||
- "127.0.0.1:80:11451"
|
||||
volumes:
|
||||
- "./dist:/usr/share/nginx/html:ro"
|
||||
- "./nginx.conf:/etc/nginx/nginx.conf"
|
||||
- "./nginx.conf:/etc/nginx/nginx.conf:ro"
|
||||
- "nginx_logs:/var/log/nginx:rw"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost/health"]
|
||||
@ -19,4 +20,7 @@ services:
|
||||
- surl-network
|
||||
networks:
|
||||
surl-network:
|
||||
external: false
|
||||
volumes:
|
||||
nginx_logs:
|
||||
external: false
|
@ -6,6 +6,8 @@
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<!-- disable cache -->
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>S-URL services</title>
|
||||
</head>
|
||||
|
16
nginx.conf
16
nginx.conf
@ -1,9 +1,9 @@
|
||||
|
||||
#user nobody;
|
||||
worker_processes auto;
|
||||
daemon off;
|
||||
# daemon off;
|
||||
|
||||
#error_log logs/error.log;
|
||||
error_log logs/error.log;
|
||||
#error_log logs/error.log notice;
|
||||
#error_log logs/error.log info;
|
||||
|
||||
@ -19,11 +19,11 @@ http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
# '$status $body_bytes_sent "$http_referer" '
|
||||
# '"$http_user_agent" "$http_x_forwarded_for"';
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
#access_log logs/access.log main;
|
||||
access_log logs/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
@ -41,8 +41,8 @@ http {
|
||||
root /usr/share/nginx/html;
|
||||
#charset koi8-r;
|
||||
|
||||
#access_log logs/host.access.log main;
|
||||
access_log off;
|
||||
# access_log logs/host.access.log main;
|
||||
# access_log off;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
@ -1,5 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
import { useLocale } from "vuetify";
|
||||
import { useUserinfoStore } from "../../stores/userinfo-store";
|
||||
import { checkLogin } from "../../script/functions";
|
||||
import { ref } from "vue";
|
||||
|
||||
const userinfoStore = useUserinfoStore()
|
||||
const showLoginPrompt = ref(false)
|
||||
!async function () {
|
||||
showLoginPrompt.value = !await checkLogin()
|
||||
if (showLoginPrompt.value) userinfoStore.clearToken()
|
||||
}()
|
||||
|
||||
function jumpToHome() {
|
||||
location.href = "/"
|
||||
}
|
||||
|
||||
const { t } = useLocale()
|
||||
</script>
|
||||
@ -38,6 +52,15 @@ const { t } = useLocale()
|
||||
</v-sheet>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-dialog v-model="showLoginPrompt" width="450">
|
||||
<v-card>
|
||||
<v-card-title> notice </v-card-title>
|
||||
<v-card-text>you need to login</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn @click="jumpToHome">ok</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
@ -1,4 +1,4 @@
|
||||
import {createRouter, createWebHistory} from "vue-router";
|
||||
import {createRouter, createWebHistory, RouteRecordRaw} from "vue-router";
|
||||
import Login from "./components/views/LoginView.vue";
|
||||
import InputBox from "./components/items/InputBox.vue";
|
||||
import IntroView from "./components/views/IntroView.vue";
|
||||
@ -11,7 +11,7 @@ import Security from "./components/items/Security.vue";
|
||||
import UrlManagement from "./components/items/UrlManagement.vue";
|
||||
import UrlAdd from "./components/items/UrlAdd.vue";
|
||||
|
||||
const routes = [
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: '/',
|
||||
component: IntroView
|
||||
@ -47,6 +47,9 @@ const routes = [
|
||||
}, {
|
||||
path: '/404',
|
||||
component: NotFound
|
||||
}, {
|
||||
path: '/:pathMatch(.*)*',
|
||||
redirect: '/404'
|
||||
}
|
||||
]
|
||||
export const router = createRouter({
|
||||
|
Loading…
Reference in New Issue
Block a user