diff --git a/src/App.js b/src/App.js index 0d86e4341..b412c0e55 100644 --- a/src/App.js +++ b/src/App.js @@ -136,7 +136,7 @@ const WebIDE = Loadable({ // }) // 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。 -const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc"]; +const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin"]; class App extends Component { constructor(props) { diff --git a/src/forge/Account/bind.jsx b/src/forge/Account/bind.jsx index 33453191b..aa009cb27 100644 --- a/src/forge/Account/bind.jsx +++ b/src/forge/Account/bind.jsx @@ -3,6 +3,7 @@ import { Form , Input , Button } from 'antd'; import phone from './image/phone.svg'; import lock from "./image/lock.png"; import axios from 'axios'; +import cookie from 'react-cookies'; const phonereg = /^([1][3456789])\d{9}$/ @@ -23,6 +24,8 @@ function Bind(props){ username,password,type }).then(result=>{ if(result){ + cookie.save("supplyphone",true); + cookie.save("login",result.data.login); window.location.href = "/"+result.data.login; } }) diff --git a/src/forge/Account/unbind.jsx b/src/forge/Account/unbind.jsx index 57db4d8e3..5bab356cc 100644 --- a/src/forge/Account/unbind.jsx +++ b/src/forge/Account/unbind.jsx @@ -5,6 +5,7 @@ import lock from "./image/lock.png"; import shield from './image/shield.png'; import phone from './image/phone.svg'; import axios from 'axios'; +import cookie from 'react-cookies'; import { setmiyah } from 'educoder'; const phonereg = /^([1][3456789])\d{9}$/ @@ -19,6 +20,7 @@ function Bind(props){ const [secondsStr, setSecondsStr] = useState(60); const [ getCaptchaBut , setGetCaptchaBut ] = useState(true); + const type = props.match.params.type; //判断用户名(username)是否注册 function usernameConfirm(rule, value, callback){ @@ -153,7 +155,8 @@ function Bind(props){ login: values.username, password: values.password, password_confirmation: values.confirm_password, - code: values.captcha + code: values.captcha, + type }).then(response=>{ if(response.data && response.data.status === -6){ //验证码不正确 @@ -161,6 +164,8 @@ function Bind(props){ }else if(response.data && response.data.status === 0){ //注册成功,页面跳转即可,注册后登录流程forge处理了 + cookie.save("supplyphone",true); + cookie.save("login",response.data.login); window.location.href = "/"+values.register_username; } })