From 1107981caea0696297771ac1fda1537270dcf714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Fri, 14 Apr 2023 09:45:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=E5=89=8D=E5=90=8E?= =?UTF-8?q?=E7=A9=BA=E6=A0=BCtrim()=E5=8E=BB=E6=8E=89,=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E7=94=A8=E6=88=B7=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/loginRegister/Register.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/loginRegister/Register.jsx b/src/modules/loginRegister/Register.jsx index 5ef66b47c..970786243 100644 --- a/src/modules/loginRegister/Register.jsx +++ b/src/modules/loginRegister/Register.jsx @@ -41,7 +41,7 @@ function Register(props){ if (!err) { values.agreement && axios.post(`/accounts/register.json`, { login: values.email, - namespace: values.register_username, + namespace: values.register_username.trim(), password: values.register_psd, password_confirmation: values.psdComfirm, code: values.captcha @@ -53,7 +53,7 @@ function Register(props){ setEmailStr(values.email); }else if(response.data && response.data.status === 0){ //注册成功,页面跳转即可,注册后登录流程forge处理了 - window.location.href = "/"+values.register_username; + window.location.href = "/"+values.register_username.trim(); } else { setEmailStr(values.email); setMess(response.data.message); @@ -67,7 +67,7 @@ function Register(props){ function usernameConfirm(rule, value, callback){ setUserNameGo(true); value && (userNameGo || value !== loginStr) ? axios.post(`/accounts/check.json`, { - value: value, + value: value.trim(), type: 1 }).then(response => { if (response.data.status === -1) { @@ -238,6 +238,9 @@ function Register(props){