Browse Source

fix/improved password logic of shared view

pull/3197/head
Muhammed Mustafa 2 years ago
parent
commit
74b9e274a9
  1. 9
      packages/nc-gui-v2/pages/[projectType]/view/[viewId].vue

9
packages/nc-gui-v2/pages/[projectType]/view/[viewId].vue

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { message } from 'ant-design-vue'
import { import {
ReadonlyInj, ReadonlyInj,
ReloadViewDataHookInj, ReloadViewDataHookInj,
@ -9,6 +10,7 @@ import {
useRoute, useRoute,
useSharedView, useSharedView,
} from '#imports' } from '#imports'
import { extractSdkResponseErrorMsg } from '~/utils'
definePageMeta({ definePageMeta({
public: true, public: true,
@ -28,8 +30,13 @@ const showPassword = ref(false)
try { try {
await loadSharedView(route.params.viewId as string) await loadSharedView(route.params.viewId as string)
} catch (e) { } catch (e: any) {
if (e?.response?.status === 403) {
showPassword.value = true showPassword.value = true
} else {
console.error(e)
message.error(await extractSdkResponseErrorMsg(e))
}
} }
</script> </script>

Loading…
Cancel
Save