mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 08:06:43 +08:00
fix(wallpapers): remove cache
This commit is contained in:
+11
-13
@@ -15,9 +15,6 @@ const { global: globalTheme } = useTheme()
|
|||||||
// Vuex Store
|
// Vuex Store
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
// 从 provide 中获取全局设置
|
|
||||||
const globalSettings: any = inject('globalSettings')
|
|
||||||
|
|
||||||
// 表单
|
// 表单
|
||||||
const form = ref({
|
const form = ref({
|
||||||
username: '',
|
username: '',
|
||||||
@@ -55,15 +52,8 @@ let intervalTimer: NodeJS.Timeout | null = null
|
|||||||
// 获取背景图片
|
// 获取背景图片
|
||||||
async function fetchBackgroundImage() {
|
async function fetchBackgroundImage() {
|
||||||
try {
|
try {
|
||||||
const results: string[] = await api.get('/login/wallpapers')
|
backgroundImages.value = await api.get('/login/wallpapers')
|
||||||
if (results && results.length > 0) {
|
if (backgroundImages.value && backgroundImages.value.length > 0) {
|
||||||
results.map((url: string) => {
|
|
||||||
if (globalSettings.GLOBAL_IMAGE_CACHE)
|
|
||||||
backgroundImages.value.push(
|
|
||||||
`${import.meta.env.VITE_API_BASE_URL}system/cache/image?url=${encodeURIComponent(url)}`,
|
|
||||||
)
|
|
||||||
else backgroundImages.value.push(url)
|
|
||||||
})
|
|
||||||
// 随机打乱排序
|
// 随机打乱排序
|
||||||
backgroundImages.value.sort(() => Math.random() - 0.5)
|
backgroundImages.value.sort(() => Math.random() - 0.5)
|
||||||
backgroundImageUrl.value = backgroundImages.value[0]
|
backgroundImageUrl.value = backgroundImages.value[0]
|
||||||
@@ -180,7 +170,15 @@ function login() {
|
|||||||
|
|
||||||
// 更新token和remember状态到Vuex Store
|
// 更新token和remember状态到Vuex Store
|
||||||
store.dispatch('auth/login', {
|
store.dispatch('auth/login', {
|
||||||
token, remember, superUser, userID, userName, avatar, level, permissions })
|
token,
|
||||||
|
remember,
|
||||||
|
superUser,
|
||||||
|
userID,
|
||||||
|
userName,
|
||||||
|
avatar,
|
||||||
|
level,
|
||||||
|
permissions,
|
||||||
|
})
|
||||||
|
|
||||||
// 登录后处理
|
// 登录后处理
|
||||||
afterLogin(superUser)
|
afterLogin(superUser)
|
||||||
|
|||||||
Reference in New Issue
Block a user