A lot of things updated.

Signed-off-by: Pavel Kirilin <win10@list.ru>
This commit is contained in:
2024-05-02 04:01:11 +02:00
parent 08c44219b0
commit 8559ec7a85
13 changed files with 2395 additions and 32 deletions

1
frontend/.gitignore vendored
View File

@ -11,6 +11,7 @@ node_modules
.DS_Store
dist
dist-ssr
dev-dist
coverage
*.local

View File

@ -1,13 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Anime</title>
<link rel="mask-icon" href="/mask-icon.svg" color="#FFFFFF">
<meta name="theme-color" content="#ffffff">
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

View File

@ -24,6 +24,7 @@
"eslint-plugin-vue": "^9.23.0",
"prettier": "^3.2.5",
"vite": "^5.2.8",
"vite-plugin-pwa": "^0.20.0",
"vite-plugin-vue-devtools": "^7.0.25"
}
}

2274
frontend/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

BIN
frontend/public/icon.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -1,5 +1,5 @@
<script setup>
import { Tabbar, TabbarItem, ActionBar, ActionBarButton } from 'vant';
import { ActionBar, ActionBarButton } from 'vant';
import { postRequest } from '@/utils'

View File

@ -1,3 +1,5 @@
import { showFailToast } from 'vant';
async function postRequest(url, data) {
const response = await fetch(url, {
method: 'POST',
@ -6,7 +8,13 @@ async function postRequest(url, data) {
},
body: JSON.stringify(data)
})
return response.json()
const resp_data = await response.json()
if (!response.ok) {
showFailToast({
message: resp_data.detail
})
}
return resp_data
}

View File

@ -2,11 +2,36 @@ import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
VitePWA({
manifest: {
name: 'Anime',
short_name: 'Anime',
start_url: '/',
theme_color: '#000000',
icons: [
{
src: '/pwa-192x192.jpg',
sizes: '192x192',
type: 'image/jpeg',
},
{
src: '/pwa-512x512.jpg',
sizes: '512x512',
type: 'image/jpeg',
}
]
},
devOptions: {
enabled: true,
},
registerType: "autoUpdate",
})
],
resolve: {
alias: {