diff --git a/src/compenents/upload-image-button/upload-image-sub/index.tsx b/src/compenents/upload-image-button/upload-image-sub/index.tsx index 7a53d4e..91aa87a 100644 --- a/src/compenents/upload-image-button/upload-image-sub/index.tsx +++ b/src/compenents/upload-image-button/upload-image-sub/index.tsx @@ -26,7 +26,7 @@ export const UploadImageSub = (props: PropsInterface) => { onChange(info: any) { const { status, response } = info.file; if (status === "done") { - if (response.code == 0) { + if (response.code === 0) { message.success(`${info.file.name} 上传成功`); } else { message.error(response.msg); diff --git a/src/pages/course/compenents/create.tsx b/src/pages/course/compenents/create.tsx index 0da3266..46f0716 100644 --- a/src/pages/course/compenents/create.tsx +++ b/src/pages/course/compenents/create.tsx @@ -387,7 +387,7 @@ export const CourseCreate: React.FC = ({ setVideoVisible(false); }} onSelected={(arr: any, videos: any) => { - if (chapterType == 0) { + if (chapterType === 0) { selectData(arr, videos); } else { selectChapterData(arr, videos); diff --git a/src/pages/course/compenents/hour-update.tsx b/src/pages/course/compenents/hour-update.tsx index 15de717..d47770c 100644 --- a/src/pages/course/compenents/hour-update.tsx +++ b/src/pages/course/compenents/hour-update.tsx @@ -362,14 +362,14 @@ export const CourseHourUpdate: React.FC = ({
{ setVideoVisible(false); }} onSelected={(arr: any, videos: any) => { - if (chapterType == 0) { + if (chapterType === 0) { selectData(arr, videos); } else { selectChapterData(arr, videos); diff --git a/src/pages/course/index.tsx b/src/pages/course/index.tsx index 87de746..20f0b2a 100644 --- a/src/pages/course/index.tsx +++ b/src/pages/course/index.tsx @@ -73,7 +73,7 @@ export const CoursePage = () => { text={"分类"} onUpdate={(keys: any, title: any) => { setCategoryIds(keys); - if (typeof title == "string") { + if (typeof title === "string") { setLabel(title); } else { setLabel(title.props.children[0]); diff --git a/src/pages/resource/images/index.tsx b/src/pages/resource/images/index.tsx index 09ca393..031ceb4 100644 --- a/src/pages/resource/images/index.tsx +++ b/src/pages/resource/images/index.tsx @@ -154,7 +154,7 @@ export const ResourceImagesPage = () => { text={"图片"} onUpdate={(keys: any, title: any) => { setCategoryIds(keys); - if (typeof title == "string") { + if (typeof title === "string") { setLabel(title); } else { setLabel(title.props.children[0]); diff --git a/src/pages/resource/videos/index.tsx b/src/pages/resource/videos/index.tsx index fc5d8b6..a8d19c4 100644 --- a/src/pages/resource/videos/index.tsx +++ b/src/pages/resource/videos/index.tsx @@ -169,7 +169,7 @@ export const ResourceVideosPage = () => { text={"视频"} onUpdate={(keys: any, title: any) => { setCategoryIds(keys); - if (typeof title == "string") { + if (typeof title === "string") { setLabel(title); } else { setLabel(title.props.children[0]); diff --git a/src/utils/index.ts b/src/utils/index.ts index adccf5b..6b36269 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -92,7 +92,7 @@ export function ValidataCredentials(value: any) { let regIdCard = /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/; if (regIdCard.test(value)) { - if (value.length == 18) { + if (value.length === 18) { var idCardWi = new Array( 7, 9, @@ -120,15 +120,15 @@ export function ValidataCredentials(value: any) { var idCardMod = idCardWiSum % 11; //计算出校验码所在数组的位置 var idCardLast = value.substring(17); //得到最后一位身份证号码 //如果等于2,则说明校验码是10,身份证号码最后一位应该是X - if (idCardMod == 2) { - if (idCardLast == "X" || idCardLast == "x") { + if (idCardMod === 2) { + if (idCardLast === "X" || idCardLast === "x") { return true; } else { return false; } } else { //用计算出的验证码与最后一位身份证号码匹配,如果一致,说明通过,否则是无效的身份证号码 - if (idCardLast == idCardY[idCardMod]) { + if (idCardLast === idCardY[idCardMod]) { return true; } else { return false;