particularly complete forum function, add point order export and user delete

This commit is contained in:
2024-03-22 01:47:55 +08:00
parent 87df8d5966
commit 932b83ddcd
52 changed files with 2806 additions and 132 deletions

View File

@@ -1,6 +1,8 @@
import { useStorage } from '@vueuse/core'
import { UploadFileInfo, createDiscreteApi, useOsTheme } from 'naive-ui'
import { ThemeType } from './api/api-models'
import { computed } from 'vue'
import { VTSURU_API_URL } from './data/constants'
const { message } = createDiscreteApi(['message'])
@@ -9,10 +11,10 @@ export function NavigateToNewTab(url: string) {
window.open(url, '_blank')
}
const themeType = useStorage('Settings.Theme', ThemeType.Auto)
export function isDarkMode(): boolean {
export const isDarkMode = computed(() => {
if (themeType.value == ThemeType.Auto) return osThemeRef.value === 'dark'
else return themeType.value == ThemeType.Dark
}
})
export function copyToClipboard(text: string) {
if (navigator.clipboard) {
navigator.clipboard.writeText(text)
@@ -106,6 +108,13 @@ export async function getImageUploadModel(
}
return result
}
export function getUserAvatarUrl(userId: number) {
return VTSURU_API_URL + 'user-face/' + userId
}
export function getOUIdAvatarUrl(ouid: string) {
return VTSURU_API_URL + 'face/' + ouid
}
export class GuidUtils {
// 将数字转换为GUID
public static numToGuid(value: number): string {