Browse Source

fix/improved password logic of shared view

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

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

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

Loading…
Cancel
Save