Browse Source

chore: 解决首页img path

master
wangxiang 2 years ago
parent
commit
67e9cca1e8
No known key found for this signature in database
GPG Key ID: 1BA7946AB6B232E4
  1. 7
      src/views/system/user/sso/index.vue
  2. 10
      src/views/system/user/sso/sso.data.ts

7
src/views/system/user/sso/index.vue

@ -44,7 +44,7 @@
/> />
</template> </template>
<template v-else-if="column.key === 'avatar'"> <template v-else-if="column.key === 'avatar'">
<TableImg :size="60" :simpleShow="true" :imgList="text"/> <TableImg :size="60" :simpleShow="true" :imgList="getOssImgUrl(text)"/>
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
@ -69,6 +69,8 @@
import SsoModal from './SsoModal.vue'; import SsoModal from './SsoModal.vue';
import { columns, searchFormSchema } from './sso.data'; import { columns, searchFormSchema } from './sso.data';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { isUrl } from '/@/utils/is';
import { useGlobSetting } from '/@/hooks/setting';
interface TableState { interface TableState {
ids: string[]; ids: string[];
@ -94,6 +96,7 @@
// //
multiple: true, multiple: true,
}); });
const { apiUrl } = useGlobSetting();
const { createConfirm, createMessage } = useMessage(); const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const [registerResetPwdModal, { openModal: openResetPwdModal }] = useModal(); const [registerResetPwdModal, { openModal: openResetPwdModal }] = useModal();
@ -124,6 +127,7 @@
}, },
handleSearchInfoFn: () => clearSelectedRowKeys() handleSearchInfoFn: () => clearSelectedRowKeys()
}); });
const getOssImgUrl = (url: string) => isUrl(url) ? [url] : [apiUrl + url];
/** 处理多选框选中数据 */ /** 处理多选框选中数据 */
function handleSelectionChange(selection?: Recordable) { function handleSelectionChange(selection?: Recordable) {
@ -181,6 +185,7 @@
handleSelectionChange, handleSelectionChange,
handleRefreshTable, handleRefreshTable,
handleResetPassword, handleResetPassword,
getOssImgUrl
}; };
} }
}); });

10
src/views/system/user/sso/sso.data.ts

@ -10,16 +10,16 @@ import { SystemUserType } from '/@/enums/permissionEnum';
/** 表格列配置 */ /** 表格列配置 */
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{
title: '用户名',
dataIndex: 'userName',
width: 120
},
{ {
title: '头像', title: '头像',
dataIndex: 'avatar', dataIndex: 'avatar',
width: 120, width: 120,
}, },
{
title: '用户名',
dataIndex: 'userName',
width: 120
},
{ {
title: '昵称', title: '昵称',
dataIndex: 'nickName', dataIndex: 'nickName',

Loading…
Cancel
Save