Skip to content

Commit dcb60d7

Browse files
committed
fix: fix video error
1 parent b0e5d86 commit dcb60d7

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

src/components/hooks/useTable/index.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ const useTable = (props) => {
6565
}
6666

6767
const updateTable = (params) => {
68-
const { dataInterface, payload = {} } = params || {}
68+
const { dataInterface, payload } = params || {}
69+
const safePayload = payload && typeof payload === 'object' ? payload : {}
6970

70-
setPage(payload.page || 1)
71-
setPageSize(payload.pageSize || 10)
72-
setCachePayload({ ...payload })
71+
setPage(safePayload.page || 1)
72+
setPageSize(safePayload.pageSize || 10)
73+
setCachePayload({ ...safePayload })
7374
getTableList(dataInterface || props.dataInterface, {
7475
...cachePayload,
75-
...payload,
76+
...safePayload,
7677
})
7778
}
7879

src/components/stateless/SmartVideoPlayer/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'
22
import { createPortal } from 'react-dom'
33
import useVideo from '@hooks/useVideo'
4-
import styles from './index.module.css'
5-
64
import {
75
Play,
86
Pause,
@@ -20,6 +18,8 @@ import {
2018
Minimize2,
2119
} from 'lucide-react'
2220

21+
import styles from './index.module.css'
22+
2323
const DEFAULT_INITIAL_CONFIG = {
2424
lazyPlay: true,
2525
miniPlayer: true,

webpack/webpack.common.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,32 @@ const config = {
136136
fullySpecified: false,
137137
},
138138
},
139+
{
140+
test: /\.module\.css$/,
141+
use: [
142+
'style-loader',
143+
{
144+
loader: 'css-loader',
145+
options: {
146+
sourceMap: true,
147+
modules: {
148+
mode: 'local',
149+
auto: true,
150+
exportGlobals: true,
151+
localIdentName: isDev ? '[path][name]__[local]--[hash:base64:5]' : '[local]--[hash:base64:5]',
152+
localIdentContext: paths.src,
153+
namedExport: false,
154+
exportLocalsConvention: 'camelCase',
155+
},
156+
importLoaders: 1,
157+
},
158+
},
159+
'postcss-loader',
160+
],
161+
},
139162
{
140163
test: /\.css$/,
164+
exclude: /\.module\.css$/,
141165
use: ['style-loader', 'css-loader', 'postcss-loader'],
142166
},
143167
{

0 commit comments

Comments
 (0)