diff --git a/.gitignore b/.gitignore index ebe41a5..fb4ecce 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ obj/ /packages .vs Logs/ +/Api/Ewide.Web.Entry/wwwroot/Upload diff --git a/Api/Ewide.Core/Service/File/SysFileService.cs b/Api/Ewide.Core/Service/File/SysFileService.cs index 8990b55..55e22fa 100644 --- a/Api/Ewide.Core/Service/File/SysFileService.cs +++ b/Api/Ewide.Core/Service/File/SysFileService.cs @@ -106,7 +106,6 @@ namespace Ewide.Core.Service /// /// [HttpGet("/sysFileInfo/preview")] - [AllowAnonymous] public async Task PreviewFileInfo([FromQuery] QueryFileInoInput input) { return await DownloadFileInfo(input); diff --git a/Web/src/components/yoImage/index.js b/Web/src/components/yoImage/index.js new file mode 100644 index 0000000..278a46a --- /dev/null +++ b/Web/src/components/yoImage/index.js @@ -0,0 +1,35 @@ +import { ArrayBufferToBase64 } from '@/util/file' + +export default { + props: { + type: { + type: String, + default: 'image' + }, + id: { + type: [String, Number], + require: true + } + }, + data() { + return { + src: '' + } + }, + + created() { + if (this.id) { + this.$api.sysFileInfoPreview({ id: this.id }).then(async ({ data }) => { + const base64 = await ArrayBufferToBase64(data) + this.src = base64 + }) + } + }, + + render() { + return this.type == 'avatar' ? + + : + + }, +} \ No newline at end of file diff --git a/Web/src/main.js b/Web/src/main.js index 3f28849..e59459e 100644 --- a/Web/src/main.js +++ b/Web/src/main.js @@ -53,6 +53,8 @@ import YoTable from './components/yoTable' Vue.component('YoTable', YoTable) import YoTableActions from './components/yoTableActions' Vue.component('YoTableActions', YoTableActions) +import YoImage from './components/yoImage' +Vue.component('YoImage', YoImage) /** * 引入主题样式 diff --git a/Web/src/pages/system/user/index.vue b/Web/src/pages/system/user/index.vue index 8adc43a..18ca910 100644 --- a/Web/src/pages/system/user/index.vue +++ b/Web/src/pages/system/user/index.vue @@ -80,12 +80,13 @@
{{ record.nickName || record.name }}
{{ record.account }}
-
@@ -120,8 +121,6 @@