mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
update vef alert
This commit is contained in:
@@ -147,3 +147,50 @@ export async function UploadConfig(name: string, data: unknown) {
|
||||
}
|
||||
return false
|
||||
}
|
||||
export async function EnableFunction(func: FunctionTypes) {
|
||||
if (ACCOUNT.value) {
|
||||
if (ACCOUNT.value.settings.enableFunctions.includes(func)) {
|
||||
return true
|
||||
} else {
|
||||
ACCOUNT.value.settings.enableFunctions.push(func)
|
||||
if (await updateFunctionEnable()) {
|
||||
return true
|
||||
} else {
|
||||
ACCOUNT.value.settings.enableFunctions.splice(ACCOUNT.value.settings.enableFunctions.indexOf(func), 1)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
export async function DisableFunction(func: FunctionTypes) {
|
||||
if (ACCOUNT.value) {
|
||||
if (!ACCOUNT.value.settings.enableFunctions.includes(func)) {
|
||||
return true
|
||||
} else {
|
||||
ACCOUNT.value.settings.enableFunctions.splice(ACCOUNT.value.settings.enableFunctions.indexOf(func), 1)
|
||||
if (await updateFunctionEnable()) {
|
||||
return true
|
||||
} else {
|
||||
ACCOUNT.value.settings.enableFunctions.push(func)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
async function updateFunctionEnable() {
|
||||
if (ACCOUNT.value) {
|
||||
try {
|
||||
const data = await SaveEnableFunctions(ACCOUNT.value.settings.enableFunctions)
|
||||
if (data.code == 200) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@ export enum FunctionTypes {
|
||||
Schedule,
|
||||
SongRequest,
|
||||
Queue,
|
||||
Point
|
||||
}
|
||||
export interface SongAuthorInfo {
|
||||
name: string
|
||||
@@ -499,3 +500,29 @@ export enum FeedbackStatus {
|
||||
Reject,
|
||||
Developing,
|
||||
}
|
||||
export interface TagInfo
|
||||
{
|
||||
name: string
|
||||
color: string
|
||||
}
|
||||
export enum GoodsStatus
|
||||
{
|
||||
Normal, // 商品正常
|
||||
//OutOfStock, // 商品无货
|
||||
Discontinued // 商品下架
|
||||
}
|
||||
export enum GoodsTypes {
|
||||
Physical,
|
||||
Virtual,
|
||||
}
|
||||
export interface ResponsePointGoodModel {
|
||||
id: number
|
||||
name: string
|
||||
count: number
|
||||
price: number
|
||||
tags: TagInfo[]
|
||||
cover?: string
|
||||
images: string[]
|
||||
status: GoodsStatus
|
||||
type: GoodsTypes
|
||||
}
|
||||
Reference in New Issue
Block a user