feat: improve admin workflows and open-source docs

This commit is contained in:
YGC
2026-07-02 21:38:54 +08:00
parent eb568d3786
commit 751fdddc71
22 changed files with 598 additions and 152 deletions
+3 -3
View File
@@ -51,7 +51,7 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useMessage, NForm, NFormItem, NInput, NButton } from 'naive-ui'
import axios from 'axios'
import request from '@/api/request'
const message = useMessage()
const saving = ref(false)
@@ -65,7 +65,7 @@ const aiConfig = ref({
const fetchConfigs = async () => {
try {
const token = localStorage.getItem('satoken')
const response = await axios.get('http://localhost:8080/api/config/list', {
const response = await request.get('/config/list', {
headers: { satoken: token }
})
@@ -96,7 +96,7 @@ const handleSave = async () => {
]
try {
const response = await axios.post('http://localhost:8080/api/config/update-batch', payload, {
const response = await request.post('/config/update-batch', payload, {
headers: { satoken: token }
})
+3 -3
View File
@@ -56,7 +56,7 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useMessage, NForm, NFormItem, NInput, NButton } from 'naive-ui'
import axios from 'axios'
import request from '@/api/request'
const getBlogUrl = (path: string) => {
const protocol = window.location.protocol
@@ -108,7 +108,7 @@ const encryptKey = (str: string): string => {
const fetchConfigs = async () => {
try {
const token = localStorage.getItem('satoken')
const response = await axios.get('http://localhost:8080/api/config/list', {
const response = await request.get('/config/list', {
headers: { satoken: token }
})
@@ -154,7 +154,7 @@ const handleSave = async () => {
]
try {
const response = await axios.post('http://localhost:8080/api/config/update-batch', payload, {
const response = await request.post('/config/update-batch', payload, {
headers: { satoken: token }
})
+3 -3
View File
@@ -38,7 +38,7 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useMessage, NForm, NFormItem, NInput, NButton } from 'naive-ui'
import axios from 'axios'
import request from '@/api/request'
const message = useMessage()
const saving = ref(false)
@@ -53,7 +53,7 @@ const beian = ref({
const fetchConfigs = async () => {
try {
const token = localStorage.getItem('satoken')
const response = await axios.get('http://localhost:8080/api/config/list', {
const response = await request.get('/config/list', {
headers: { satoken: token }
})
@@ -86,7 +86,7 @@ const handleSave = async () => {
]
try {
const response = await axios.post('http://localhost:8080/api/config/update-batch', payload, {
const response = await request.post('/config/update-batch', payload, {
headers: { satoken: token }
})
+3 -3
View File
@@ -31,7 +31,7 @@
<div class="flex items-center gap-2 shrink-0 justify-end sm:justify-start">
<n-button secondary size="small" class="shrink-0" @click="openGallerySelect('logoUrl')">相册选择</n-button>
<n-upload
action="http://localhost:8080/api/blogs/upload?type=brand"
action="/api/blogs/upload?type=brand"
:headers="uploadHeaders"
:show-file-list="false"
class="flex shrink-0"
@@ -62,7 +62,7 @@
<div class="flex items-center gap-2 shrink-0 justify-end sm:justify-start">
<n-button secondary size="small" class="shrink-0" @click="openGallerySelect('faviconUrl')">相册选择</n-button>
<n-upload
action="http://localhost:8080/api/blogs/upload?type=brand"
action="/api/blogs/upload?type=brand"
:headers="uploadHeaders"
:show-file-list="false"
class="flex shrink-0"
@@ -110,7 +110,7 @@
<div class="flex items-center gap-2 shrink-0 justify-end sm:justify-start">
<n-button secondary size="small" class="shrink-0" @click="openGallerySelect('heroBgUrl')">相册选择</n-button>
<n-upload
action="http://localhost:8080/api/blogs/upload?type=brand"
action="/api/blogs/upload?type=brand"
:headers="uploadHeaders"
:show-file-list="false"
class="flex shrink-0"
@@ -1,4 +1,4 @@
<template>
<template>
<div class="space-y-6">
<div class="archive-card p-5 sm:p-6 bg-(--archive-bg-card) border border-(--archive-border) rounded-2xl">
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-4 border-b border-(--archive-border)/40">
@@ -69,7 +69,7 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useMessage, NForm, NFormItem, NInput, NButton } from 'naive-ui'
import axios from 'axios'
import request from '@/api/request'
const getBlogUrl = (path: string) => {
const protocol = window.location.protocol
@@ -98,7 +98,7 @@ const dbConfig = ref({
const fetchDbConfig = async () => {
try {
const token = localStorage.getItem('satoken')
const response = await axios.get('http://localhost:8080/api/config/database', {
const response = await request.get('/config/database', {
headers: { satoken: token }
})
if (response.data && response.data.code === 200) {
@@ -113,7 +113,7 @@ const handleSave = async () => {
saving.value = true
const token = localStorage.getItem('satoken')
try {
const response = await axios.post('http://localhost:8080/api/config/database', dbConfig.value, {
const response = await request.post('/config/database', dbConfig.value, {
headers: { satoken: token }
})
if (response.data && response.data.code === 200) {
@@ -1,4 +1,4 @@
<template>
<template>
<div class="space-y-6">
<div class="archive-card p-5 sm:p-6 bg-(--archive-bg-card) border border-(--archive-border) rounded-2xl">
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-4 border-b border-(--archive-border)/40">
@@ -99,7 +99,7 @@
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import { useMessage, NForm, NFormItem, NSelect, NInput, NButton } from 'naive-ui'
import axios from 'axios'
import request from '@/api/request'
const getBlogUrl = (path: string) => {
const protocol = window.location.protocol
@@ -159,7 +159,7 @@ const activeStorageLabel = computed(() => {
const fetchConfigs = async () => {
try {
const token = localStorage.getItem('satoken')
const response = await axios.get('http://localhost:8080/api/config/list', {
const response = await request.get('/config/list', {
headers: { satoken: token }
})
@@ -203,7 +203,7 @@ const handleSave = async () => {
]
try {
const response = await axios.post('http://localhost:8080/api/config/update-batch', payload, {
const response = await request.post('/config/update-batch', payload, {
headers: { satoken: token }
})
+5 -5
View File
@@ -153,7 +153,7 @@
<div class="flex flex-wrap items-center gap-2 mb-2">
<n-upload
action="http://localhost:8080/api/blogs/upload?type=theme"
action="/api/blogs/upload?type=theme"
:headers="uploadHeaders"
:show-file-list="false"
@finish="handleBgUploadFinish"
@@ -260,7 +260,7 @@
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import { useMessage, NForm, NFormItem, NInput, NInputNumber, NSwitch, NUpload, NButton, NModal, NSpin } from 'naive-ui'
import axios from 'axios'
import request from '@/api/request'
const message = useMessage()
const saving = ref(false)
@@ -303,7 +303,7 @@ const uploadHeaders = computed(() => ({
const fetchConfigs = async () => {
try {
const token = localStorage.getItem('satoken')
const response = await axios.get('http://localhost:8080/api/config/list', {
const response = await request.get('/config/list', {
headers: { satoken: token }
})
@@ -362,7 +362,7 @@ const handleSave = async () => {
]
try {
const response = await axios.post('http://localhost:8080/api/config/update-batch', payload, {
const response = await request.post('/config/update-batch', payload, {
headers: { satoken: token }
})
@@ -412,7 +412,7 @@ const openGallerySelect = async () => {
selectedPhotoUrl.value = theme.value.bgImageUrl || ''
const token = localStorage.getItem('satoken')
try {
const response = await axios.get('http://localhost:8080/api/gallery/list', {
const response = await request.get('/gallery/list', {
headers: { satoken: token }
})
if (response.data && response.data.code === 200) {
@@ -108,7 +108,7 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useMessage, NForm, NSwitch, NButton, NInput, NFormItem } from 'naive-ui'
import axios from 'axios'
import request from '@/api/request'
const message = useMessage()
const saving = ref(false)
@@ -127,7 +127,7 @@ const passcode = ref('2026')
const fetchConfigs = async () => {
try {
const token = localStorage.getItem('satoken')
const response = await axios.get('http://localhost:8080/api/config/list', {
const response = await request.get('/config/list', {
headers: { satoken: token }
})
@@ -166,7 +166,7 @@ const handleSave = async () => {
]
try {
const response = await axios.post('http://localhost:8080/api/config/update-batch', payload, {
const response = await request.post('/config/update-batch', payload, {
headers: { satoken: token }
})