feat(sj_1.0.0): 优化组普通用户更新权限问题

This commit is contained in:
opensnail 2024-06-08 09:49:53 +08:00
parent 61c8bf6473
commit ff583bc853
7 changed files with 17 additions and 4 deletions

2
.env
View File

@ -50,3 +50,5 @@ VITE_SOURCE_MAP=N
VITE_STORAGE_PREFIX=
VITE_ICONIFY_URL=/iconify
VITE_UPDATE_NOTIFY=N

View File

@ -4,3 +4,5 @@ VITE_ICONIFY_URL=/snail-job/iconify
# backend service base url, prod environment
VITE_SERVICE_BASE_URL=/snail-job
VITE_UPDATE_NOTIFY=N

View File

@ -2,3 +2,5 @@ VITE_BASE_URL=/
# backend service base url, test environment
VITE_SERVICE_BASE_URL=http://localhost:8080/snail-job
VITE_UPDATE_NOTIFY=N

View File

@ -5,6 +5,10 @@ defineOptions({
name: 'StatusSwitch'
});
const props = defineProps({
disabled: Boolean
});
const modelValue = defineModel<Api.Common.EnableStatusNumber>('value', { default: 0 });
interface Emits {
@ -31,6 +35,7 @@ const handleUpdateValue = (value: Api.Common.EnableStatusNumber) => {
:rubber-band="false"
:checked-value="1"
:unchecked-value="0"
:disabled="props.disabled"
@update:value="handleUpdateValue"
/>
</template>

View File

@ -6,7 +6,8 @@ export function setupAppVersionNotification() {
document.addEventListener('visibilitychange', async () => {
const buildTime = await getHtmlBuildTime();
if (buildTime !== BUILD_TIME && document.visibilityState === 'visible') {
const { VITE_UPDATE_NOTIFY } = import.meta.env;
if (buildTime !== BUILD_TIME && document.visibilityState === 'visible' && VITE_UPDATE_NOTIFY === 'Y') {
const n = window.$notification?.create({
title: $t('system.updateTitle'),
content: $t('system.updateContent'),

View File

@ -75,8 +75,9 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
}
callback();
};
return <StatusSwitch v-model:value={row.groupStatus} onFetch={fetchFn} />;
return (
<StatusSwitch v-model:value={row.groupStatus} onFetch={fetchFn} disabled={hasAuth('R_USER') as boolean} />
);
}
},
{

View File

@ -85,7 +85,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
width: 130,
render: row => (
<div class="flex-center gap-8px">
<NButton type="primary" ghost size="small" onClick={() => edit(row.id!)}>
<NButton type="primary" text ghost size="small" onClick={() => edit(row.id!)}>
{$t('common.edit')}
</NButton>
{hasAuth('R_ADMIN') ? (