From 21b4e0e51d2a5ad2717a8ee74b72929ffdfbfd58 Mon Sep 17 00:00:00 2001 From: sh1luo <690898835@qq.com> Date: Sun, 25 Jul 2021 11:10:45 +0800 Subject: [PATCH] fix: clear all console warnings (#192) Signed-off-by: sh1luo <690898835@qq.com> --- web/src/App.js | 2 +- web/src/LdapEditPage.js | 1 - web/src/ProviderEditPage.js | 3 +-- web/src/RecordListPage.js | 2 +- web/src/UserEditPage.js | 1 - web/src/UserListPage.js | 2 +- web/src/auth/DingTalkLoginButton.js | 2 +- web/src/auth/FacebookLoginButton.js | 2 +- web/src/auth/ForgetPage.js | 4 ++++ web/src/auth/GitHubLoginButton.js | 2 +- web/src/auth/GiteeLoginButton.js | 2 +- web/src/auth/GoogleLoginButton.js | 2 +- web/src/auth/WechatLoginButton.js | 2 +- web/src/auth/WeiboLoginButton.js | 2 +- web/src/component/CountDownInput.js | 8 +++++--- 15 files changed, 20 insertions(+), 17 deletions(-) diff --git a/web/src/App.js b/web/src/App.js index c0335248..77200b60 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -49,7 +49,7 @@ import SelectLanguageBox from './SelectLanguageBox'; import i18next from 'i18next'; import PromptPage from "./auth/PromptPage"; -const { Header, Footer, Content } = Layout; +const { Header, Footer } = Layout; class App extends Component { constructor(props) { diff --git a/web/src/LdapEditPage.js b/web/src/LdapEditPage.js index 3adc54c5..c56273d0 100644 --- a/web/src/LdapEditPage.js +++ b/web/src/LdapEditPage.js @@ -19,7 +19,6 @@ import * as LddpBackend from "./backend/LdapBackend"; import * as OrganizationBackend from "./backend/OrganizationBackend"; import * as Setting from "./Setting"; import i18next from "i18next"; -import i18n from "i18next"; const {Option} = Select; diff --git a/web/src/ProviderEditPage.js b/web/src/ProviderEditPage.js index a5fef2f9..7cc15f4c 100644 --- a/web/src/ProviderEditPage.js +++ b/web/src/ProviderEditPage.js @@ -13,12 +13,11 @@ // limitations under the License. import React from "react"; -import {Button, Card, Col, Input, InputNumber, Row, Select, Switch} from 'antd'; +import {Button, Card, Col, Input, InputNumber, Row, Select} from 'antd'; import {LinkOutlined} from "@ant-design/icons"; import * as ProviderBackend from "./backend/ProviderBackend"; import * as Setting from "./Setting"; import i18next from "i18next"; -import {getLabel} from "./Setting"; const { Option } = Select; const { TextArea } = Input; diff --git a/web/src/RecordListPage.js b/web/src/RecordListPage.js index 2e305128..de0bc1bd 100644 --- a/web/src/RecordListPage.js +++ b/web/src/RecordListPage.js @@ -14,7 +14,7 @@ import React from "react"; import {Link} from "react-router-dom"; -import {Col, Row, Table} from 'antd'; +import {Table} from 'antd'; import * as Setting from "./Setting"; import * as RecordBackend from "./backend/RecordBackend"; import i18next from "i18next"; diff --git a/web/src/UserEditPage.js b/web/src/UserEditPage.js index ec03e670..d1dd0e8e 100644 --- a/web/src/UserEditPage.js +++ b/web/src/UserEditPage.js @@ -26,7 +26,6 @@ import ResetModal from "./ResetModal"; import AffiliationSelect from "./common/AffiliationSelect"; import OAuthWidget from "./common/OAuthWidget"; -import {Controlled as CodeMirror} from 'react-codemirror2' import "codemirror/lib/codemirror.css" require('codemirror/theme/material-darker.css'); require("codemirror/mode/javascript/javascript"); diff --git a/web/src/UserListPage.js b/web/src/UserListPage.js index 30cc8cad..e843e54d 100644 --- a/web/src/UserListPage.js +++ b/web/src/UserListPage.js @@ -266,7 +266,7 @@ class UserListPage extends React.Component { return (
- (
{i18next.t("general:Users")}     diff --git a/web/src/auth/DingTalkLoginButton.js b/web/src/auth/DingTalkLoginButton.js index 8dc7defb..ed335500 100644 --- a/web/src/auth/DingTalkLoginButton.js +++ b/web/src/auth/DingTalkLoginButton.js @@ -16,7 +16,7 @@ import {createButton} from "react-social-login-buttons"; import {StaticBaseUrl} from "../Setting"; function Icon({ width = 24, height = 24, color }) { - return ; + return Sign in with DingTalk; } const config = { diff --git a/web/src/auth/FacebookLoginButton.js b/web/src/auth/FacebookLoginButton.js index 90f4599a..a7ada7e1 100644 --- a/web/src/auth/FacebookLoginButton.js +++ b/web/src/auth/FacebookLoginButton.js @@ -16,7 +16,7 @@ import {createButton} from "react-social-login-buttons"; import {StaticBaseUrl} from "../Setting"; function Icon({ width = 24, height = 24, color }) { - return ; + return Sign in with Facebook; } const config = { diff --git a/web/src/auth/ForgetPage.js b/web/src/auth/ForgetPage.js index fa82b47a..8a30fc3f 100644 --- a/web/src/auth/ForgetPage.js +++ b/web/src/auth/ForgetPage.js @@ -111,6 +111,8 @@ class ForgetPage extends React.Component { case "phone": this.setState({isFixed: true, fixedContent: res.data.phone, verifyType: "phone"}); break + default: + break } if (this.state.isFixed) { forms.step2.setFieldsValue({email: this.state.fixedContent}) @@ -139,6 +141,8 @@ class ForgetPage extends React.Component { } }) break + default: + break } } diff --git a/web/src/auth/GitHubLoginButton.js b/web/src/auth/GitHubLoginButton.js index f3048812..6a30fc59 100644 --- a/web/src/auth/GitHubLoginButton.js +++ b/web/src/auth/GitHubLoginButton.js @@ -16,7 +16,7 @@ import {createButton} from "react-social-login-buttons"; import {StaticBaseUrl} from "../Setting"; function Icon({ width = 24, height = 24, color }) { - return ; + return Sign in with GitHub; } const config = { diff --git a/web/src/auth/GiteeLoginButton.js b/web/src/auth/GiteeLoginButton.js index d9c0b6f3..33a52501 100644 --- a/web/src/auth/GiteeLoginButton.js +++ b/web/src/auth/GiteeLoginButton.js @@ -16,7 +16,7 @@ import {createButton} from "react-social-login-buttons"; import {StaticBaseUrl} from "../Setting"; function Icon({ width = 24, height = 24, color }) { - return ; + return Sign in with Gitee; } const config = { diff --git a/web/src/auth/GoogleLoginButton.js b/web/src/auth/GoogleLoginButton.js index 472a5ed2..e07d07f2 100644 --- a/web/src/auth/GoogleLoginButton.js +++ b/web/src/auth/GoogleLoginButton.js @@ -16,7 +16,7 @@ import {createButton} from "react-social-login-buttons"; import {StaticBaseUrl} from "../Setting"; function Icon({ width = 24, height = 24, color }) { - return ; + return Sign in with Google; } const config = { diff --git a/web/src/auth/WechatLoginButton.js b/web/src/auth/WechatLoginButton.js index 9b7f76b6..c635f72d 100644 --- a/web/src/auth/WechatLoginButton.js +++ b/web/src/auth/WechatLoginButton.js @@ -16,7 +16,7 @@ import {createButton} from "react-social-login-buttons"; import {StaticBaseUrl} from "../Setting"; function Icon({ width = 24, height = 24, color }) { - return ; + return Sign in with Wechat; } const config = { diff --git a/web/src/auth/WeiboLoginButton.js b/web/src/auth/WeiboLoginButton.js index e946e0d4..a7028dc8 100644 --- a/web/src/auth/WeiboLoginButton.js +++ b/web/src/auth/WeiboLoginButton.js @@ -16,7 +16,7 @@ import {createButton} from "react-social-login-buttons"; import {StaticBaseUrl} from "../Setting"; function Icon({ width = 24, height = 24, color }) { - return ; + return Sign in with Weibo; } const config = { diff --git a/web/src/component/CountDownInput.js b/web/src/component/CountDownInput.js index 65794f8c..4dd10d26 100644 --- a/web/src/component/CountDownInput.js +++ b/web/src/component/CountDownInput.js @@ -28,14 +28,14 @@ export const CountDownInput = (props) => { const [key, setKey] = React.useState(""); const [captchaImg, setCaptchaImg] = React.useState(""); const [checkType, setCheckType] = React.useState(""); - const [coolDown, setCoolDown] = React.useState(false); + // const [coolDown, setCoolDown] = React.useState(false); const [checkId, setCheckId] = React.useState(""); const [buttonDisabled, setButtonDisabled] = React.useState(false); const countDown = (leftTime) => { if (leftTime === 0) { setButtonDisabled(false); - setCoolDown(false); + // setCoolDown(false); setButtonText(defaultButtonText); return; } @@ -48,7 +48,7 @@ export const CountDownInput = (props) => { onButtonClick(checkType, checkId, key, ...onButtonClickArgs).then(res => { setKey(""); if (res) { - setCoolDown(true); + // setCoolDown(true); setButtonDisabled(true) countDown(coolDownTime); } @@ -107,6 +107,8 @@ export const CountDownInput = (props) => { return ; case "AuditOutlined": return ; + default: + return null; } };