diff --git a/frontend/components.d.ts b/frontend/components.d.ts index b974aa5..6620659 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -50,43 +50,29 @@ declare module 'vue' { EditType: typeof import('./src/components/builtin/EditType.vue')['default'] ElAside: typeof import('element-plus/es')['ElAside'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] - ElBadge: typeof import('element-plus/es')['ElBadge'] ElButton: typeof import('element-plus/es')['ElButton'] ElCard: typeof import('element-plus/es')['ElCard'] ElCarousel: typeof import('element-plus/es')['ElCarousel'] ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'] - ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCol: typeof import('element-plus/es')['ElCol'] - ElColorPicker: typeof import('element-plus/es')['ElColorPicker'] ElContainer: typeof import('element-plus/es')['ElContainer'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElDrawer: typeof import('element-plus/es')['ElDrawer'] - ElDropdown: typeof import('element-plus/es')['ElDropdown'] - ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] - ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] - ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElFooter: typeof import('element-plus/es')['ElFooter'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElHeader: typeof import('element-plus/es')['ElHeader'] ElIcon: typeof import('element-plus/es')['ElIcon'] - ElImage: typeof import('element-plus/es')['ElImage'] ElInput: typeof import('element-plus/es')['ElInput'] ElMain: typeof import('element-plus/es')['ElMain'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] - ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] - ElPopover: typeof import('element-plus/es')['ElPopover'] ElProgress: typeof import('element-plus/es')['ElProgress'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] - ElSelect: typeof import('element-plus/es')['ElSelect'] - ElSwitch: typeof import('element-plus/es')['ElSwitch'] - ElTable: typeof import('element-plus/es')['ElTable'] - ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] - ElText: typeof import('element-plus/es')['ElText'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] + ElTransfer: typeof import('element-plus/es')['ElTransfer'] ElTree: typeof import('element-plus/es')['ElTree'] ElUpload: typeof import('element-plus/es')['ElUpload'] Error: typeof import('./src/components/taskbar/Error.vue')['default'] diff --git a/frontend/src/components/builtin/FileList.vue b/frontend/src/components/builtin/FileList.vue index d500e90..9e969c7 100644 --- a/frontend/src/components/builtin/FileList.vue +++ b/frontend/src/components/builtin/FileList.vue @@ -369,7 +369,7 @@ function handleRightClick(mouse: MouseEvent, item: OsFileWithoutContent, index: }, ]; - if (item.isShare && item.path.indexOf('/F/othershare') !== 0) { + if (!item.isShare || item.path.indexOf('/F/othershare') !== 0) { fileMenus.push({ label: t('delete'), click: async () => { @@ -385,7 +385,7 @@ function handleRightClick(mouse: MouseEvent, item: OsFileWithoutContent, index: }) } const userType = sys.getConfig('userType'); - if (userType == 'member' && !item.isShare) { + if (userType == 'member' && !item.isShare && !item.isDirectory) { menuArr.push( { diff --git a/frontend/src/components/builtin/FileProps.vue b/frontend/src/components/builtin/FileProps.vue index 47799c1..86be739 100644 --- a/frontend/src/components/builtin/FileProps.vue +++ b/frontend/src/components/builtin/FileProps.vue @@ -79,6 +79,7 @@ const file = ref(); const path = window?.config.content if(path.indexOf('/F') === 0) { file.value = (await useSystem()?.fs.getShareInfo(path)).fi + // file.value.path = file.value.titleName || file.value.path } else { file.value = await useSystem()?.fs.stat(path); } diff --git a/frontend/src/components/chat/ChatUserSetting.vue b/frontend/src/components/chat/ChatUserSetting.vue index a655261..9be4aa9 100644 --- a/frontend/src/components/chat/ChatUserSetting.vue +++ b/frontend/src/components/chat/ChatUserSetting.vue @@ -2,7 +2,8 @@ import { t } from '@/i18n'; import { ref, onMounted } from "vue"; import { useChatStore } from "@/stores/chat"; -import { fetchGet, getSystemConfig } from "@/system/config"; +import { notifyError, notifySuccess } from "@/util/msg"; +import { fetchGet, getSystemConfig, setSystemKey } from "@/system/config"; const store = useChatStore() const form = ref({ nickname: '', @@ -10,37 +11,49 @@ const form = ref({ const userInfo = getSystemConfig().userInfo const dialogShow = ref(false) let imgList = reactive([]) +let pos = ref(0) const showChange = (val) =>{ dialogShow.value = val } -const toChangeHead = ()=>{ - console.log('换头像'); +const toChangeHead = async ()=>{ + let res = await fetchGet(`${userInfo.url}/files/saveavatar?id=${userInfo.id}&name=${imgList[pos.value].name}`) + console.log('submit!:',res) + if (!res.ok) { + notifyError("头像换取失败") + } else { + res = await res.json() + notifySuccess(res.message) + userInfo.avatar = imgList[pos.value].name + store.userInfo.avatar = userInfo.url + '/upload/avatar/' + userInfo.avatar + setSystemKey('userInfo', userInfo) + } + showChange(false) } // 获取头像列表 -const getHeadList = async() => { - const res = await fetchGet(`${userInfo.url}/files/avatarlist`) +const getHeadList = async () => { + let res = await fetchGet (`${userInfo.url}/files/avatarlist`) + // const apiUrl = getSystemConfig().apiUrl + '/upload/avatar/'; + const apiUrl = userInfo.url + '/upload/avatar/'; if (res.ok) { - imgList = await res.json() - imgList = imgList.data.map(item => { - item.isChoose = false - return item - }) - imgList[0].isChoose = true + res = await res.json() + for (const item of res.data) { + imgList.push({ + url: apiUrl + item, + name: item + }) + } } - console.log('imgList:' , imgList); } -let pos = ref(0) // 换头像 const chooseImg = (index) => { - imgList.forEach(item => item.isChoose = false) - imgList[index].isChoose = true pos.value = index } -const onSubmit = () => { - console.log('submit!') +const onSubmit = async () => { + console.log('提交'); } onMounted(()=>{ getHeadList() + store.userInfo.avatar = userInfo.url + '/upload/avatar/' + userInfo.avatar })