feat(sj_1.0.0): 优化组普通用户更新权限问题
This commit is contained in:
		
							parent
							
								
									61c8bf6473
								
							
						
					
					
						commit
						ff583bc853
					
				
							
								
								
									
										2
									
								
								.env
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								.env
									
									
									
									
									
								
							@ -50,3 +50,5 @@ VITE_SOURCE_MAP=N
 | 
			
		||||
VITE_STORAGE_PREFIX=
 | 
			
		||||
 | 
			
		||||
VITE_ICONIFY_URL=/iconify
 | 
			
		||||
 | 
			
		||||
VITE_UPDATE_NOTIFY=N
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
@ -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'),
 | 
			
		||||
 | 
			
		||||
@ -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} />
 | 
			
		||||
        );
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
@ -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') ? (
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user