Procházet zdrojové kódy

fix:调整 user 的 props.id 参数,避免 Vue warn 告警

YunaiV před 4 měsíci
rodič
revize
5aa28bc1d2

+ 1 - 1
src/pages-system/user/detail/components/password-form.vue

@@ -41,7 +41,7 @@ import { resetUserPassword } from '@/api/system/user'
 
 const props = defineProps<{
   modelValue: boolean
-  userId: number
+  userId: number | any
 }>()
 
 const emit = defineEmits<{

+ 1 - 1
src/pages-system/user/detail/components/role-assign-form.vue

@@ -28,7 +28,7 @@ import { assignUserRole, getUserRoleIds } from '@/api/system/user'
 
 const props = defineProps<{
   modelValue: boolean
-  userId: number
+  userId: number | any
 }>()
 
 const emit = defineEmits<{

+ 4 - 4
src/pages-system/user/detail/index.vue

@@ -61,9 +61,9 @@
     <!-- 更多操作菜单 -->
     <wd-action-sheet v-model="moreActionVisible" :actions="moreActions" @select="handleMoreAction" />
     <!-- 重置密码弹窗 -->
-    <PasswordForm v-model="passwordFormVisible" :user-id="Number(props.id)" @success="getDetail" />
+    <PasswordForm v-model="passwordFormVisible" :user-id="props.id" @success="getDetail" />
     <!-- 分配角色弹窗 -->
-    <RoleAssignForm v-model="roleAssignFormVisible" :user-id="Number(props.id)" @success="getDetail" />
+    <RoleAssignForm v-model="roleAssignFormVisible" :user-id="props.id" @success="getDetail" />
   </view>
 </template>
 
@@ -80,7 +80,7 @@ import RoleAssignForm from './components/role-assign-form.vue'
 import { navigateBackPlus } from '@/utils';
 
 const props = defineProps<{
-  id: string
+  id?: number | any
 }>()
 
 definePage({
@@ -127,7 +127,7 @@ async function getDetail() {
   }
   try {
     toast.loading('加载中...')
-    formData.value = await getUser(Number(props.id))
+    formData.value = await getUser(props.id)
   } finally {
     toast.close()
   }

+ 1 - 1
src/pages-system/user/form/index.vue

@@ -109,7 +109,7 @@ import PostPicker from './components/post-picker.vue'
 import { navigateBackPlus } from '@/utils';
 
 const props = defineProps<{
-  id?: string
+  id?: number | any
 }>()
 
 definePage({