api地址修改为v2

This commit is contained in:
灌糖包子 2026-03-21 03:32:22 +08:00
parent 442a5a9c73
commit f9b7f78fe8
Signed by: sookie
GPG Key ID: 0599BECB75C1E68D
3 changed files with 6 additions and 6 deletions

View File

@ -2,8 +2,8 @@
<html> <html>
<%- partial('_partial/head') %> <%- partial('_partial/head') %>
<body> <body>
<div id="container" :class="{show:isCtnShow}" style="background-image: url('/api/v1/common/randomBg?label=background');" @click="hideSlider"> <div id="container" :class="{show:isCtnShow}" style="background-image: url('/api/v2/common/randomBg?label=background');" @click="hideSlider">
<div class="left-col" style="background-image: url('/api/v1/common/randomBg?label=banner');" > <div class="left-col" style="background-image: url('/api/v2/common/randomBg?label=banner');" >
<%- partial('_partial/left-col', null, {cache: !config.relative_link}) %> <%- partial('_partial/left-col', null, {cache: !config.relative_link}) %>
<%- partial('_partial/live2d') %> <%- partial('_partial/live2d') %>
</div> </div>

View File

@ -27,7 +27,7 @@ function loadMoreItems(step) {
scrollLock = true //加载过程中锁定滚动加载 scrollLock = true //加载过程中锁定滚动加载
loadTip.style.display = 'block' loadTip.style.display = 'block'
// 滚动到底部时调用 // 滚动到底部时调用
axios.get(`${themeConfig.root}api/v1/common/photos`, {params: {start:totalIndex, limit:step}}).then(res => { axios.get(`${themeConfig.root}api/v2/common/photos`, {params: {start:totalIndex, limit:step}}).then(res => {
var itemContainer = document.createElement('div') var itemContainer = document.createElement('div')
for(let index = 0 ; index<res.data.data.length && totalIndex<res.data.total ; index++,totalIndex++ ) { for(let index = 0 ; index<res.data.data.length && totalIndex<res.data.total ; index++,totalIndex++ ) {
let imgHeight = null, imgFile = res.data.data[index], let imgHeight = null, imgFile = res.data.data[index],

View File

@ -99,7 +99,7 @@ const vm = new Vue({
limit: this.fullTextSearch.limit, limit: this.fullTextSearch.limit,
words: this.fullTextSearchWords words: this.fullTextSearchWords
} }
axios.get(window.themeConfig.root + 'api/v1/common/search', {params}).then(res => { axios.get(window.themeConfig.root + 'api/v2/common/search', {params}).then(res => {
this.fullTextSearch.isLoading = false this.fullTextSearch.isLoading = false
fullTextSearchTimer = null fullTextSearchTimer = null
let result = res.data let result = res.data
@ -225,7 +225,7 @@ function handleSearch(searchItems) {
async function welcomeMessage() { async function welcomeMessage() {
let now = new Date().getHours() let now = new Date().getHours()
return axios.get(`${window.themeConfig.root}api/v1/common/config/waifu_tip`).then(res => { return axios.get(`${window.themeConfig.root}api/v2/common/config/waifu_tip`).then(res => {
let textTimes = res.data let textTimes = res.data
let text = null let text = null
Array.prototype.sort.call(textTimes, (item1, item2) => { Array.prototype.sort.call(textTimes, (item1, item2) => {
@ -273,7 +273,7 @@ const waifuTools = {
}, },
'tools.chart'() { 'tools.chart'() {
// 一言 // 一言
axios.get(`${window.themeConfig.root}api/v1/common/hitokoto?length=40&format=json`).then(res => { axios.get(`${window.themeConfig.root}api/v2/common/hitokoto?length=40&format=json`).then(res => {
this.showMessage(res.data.hitokoto + (res.data.from?`  ——${res.data.from}`:'')) this.showMessage(res.data.hitokoto + (res.data.from?`  ——${res.data.from}`:''))
}) })
}, },