Commit 8f84ec1f by zhangleyuan

feat:修改登录和登录获取验证码的接口

parent eeef05cd
...@@ -2,18 +2,17 @@ ...@@ -2,18 +2,17 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-12-01 17:21:21 * @Date: 2020-12-01 17:21:21
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-08 10:38:04 * @LastEditTime: 2020-12-11 11:53:13
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import Service from "@/common/js/service"; import Service from "@/common/js/service";
export function getUserStore(params: object) { export function getUserStore(params: object) {
return Service.Hades("public/hades/getUserStore", params); return Service.Hades("public/hades/getUserStore", params);
} }
export function getUserPermission(params: object) { export function getUserPermission(params: object) {
return Service.Hades("public/hades/getPermission", params); return Service.Hades("public/hades/getPermission", params);
} }
export function logout(params: object) { export function logout(params: object) {
...@@ -34,4 +33,9 @@ export function sendNewPhoneAuthCode(params: object) { ...@@ -34,4 +33,9 @@ export function sendNewPhoneAuthCode(params: object) {
export function editUserPhone(params: object) { export function editUserPhone(params: object) {
return Service.Hades("public/hades/editUserPhone", params); return Service.Hades("public/hades/editUserPhone", params);
} }
export function sendLoginAuthCode(params: object) {
return Service.Hades("anon/hades/sendLoginAuthCode", params);
}
export function login(params: object) {
return Service.Hades("anon/hades/login", params);
}
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-12-01 17:20:49 * @Date: 2020-12-01 17:20:49
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-07 11:08:23 * @LastEditTime: 2020-12-11 11:50:17
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import { getUserStore, getUserPermission ,logout,getStoreUser,sendBizAuthCode,editUserPhone,checkBizAuthCode,sendNewPhoneAuthCode} from '@/data-source/base/request-apis'; import { getUserStore, getUserPermission ,logout,getStoreUser,sendBizAuthCode,editUserPhone,checkBizAuthCode,sendNewPhoneAuthCode,sendLoginAuthCode,login} from '@/data-source/base/request-apis';
export default class StoreService { export default class StoreService {
// 获取员工列表 // 获取员工列表
...@@ -40,4 +40,10 @@ export default class StoreService { ...@@ -40,4 +40,10 @@ export default class StoreService {
static sendNewPhoneAuthCode(params: any){ static sendNewPhoneAuthCode(params: any){
return sendNewPhoneAuthCode(params); return sendNewPhoneAuthCode(params);
} }
static sendLoginAuthCode(params: any){
return sendLoginAuthCode(params);
}
static login(params: any){
return login(params);
}
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import './Login.less'; ...@@ -6,6 +6,7 @@ import './Login.less';
import {Input,Popover,message} from 'antd'; import {Input,Popover,message} from 'antd';
import CheckBeforeSendCode from '../../components/CheckBeforeSendCode'; import CheckBeforeSendCode from '../../components/CheckBeforeSendCode';
import User from '@/common/js/user'; import User from '@/common/js/user';
import BaseService from "@/domains/basic-domain/baseService";
import axios from 'axios'; import axios from 'axios';
import _ from 'underscore'; import _ from 'underscore';
...@@ -19,9 +20,6 @@ function Login(props) { ...@@ -19,9 +20,6 @@ function Login(props) {
const [errorMessage,setErrorMessage] = useState(''); const [errorMessage,setErrorMessage] = useState('');
const [phoneError,setPhoneError] = useState(false); const [phoneError,setPhoneError] = useState(false);
const [checkObject1, setCheckObject1] = useState({}); const [checkObject1, setCheckObject1] = useState({});
useEffect(() => {
}, [])
async function checkAccount(code, callback = () => { }) { async function checkAccount(code, callback = () => { }) {
callback(); callback();
...@@ -52,9 +50,9 @@ function Login(props) { ...@@ -52,9 +50,9 @@ function Login(props) {
serverType: "CLOUD_CLASS_LOGIN", serverType: "CLOUD_CLASS_LOGIN",
appTermEnum:'XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN' appTermEnum:'XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN'
} }
axios.post('https://dev-heimdall.xiaomai5.com/hades/anon/hades/sendLoginAuthCode', params).then((res) => { BaseService.sendLoginAuthCode(params).then((res) => {
if (!res.data.success) { if (!res.success) {
setErrorMessage(res.data.message); setErrorMessage(res.message);
} else { } else {
timeSub(60); timeSub(60);
setChecking1(true) setChecking1(true)
...@@ -87,13 +85,12 @@ function Login(props) { ...@@ -87,13 +85,12 @@ function Login(props) {
authCode:phoneverify, authCode:phoneverify,
appTermEnum:"XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN" appTermEnum:"XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN"
} }
axios.post('https://dev-heimdall.xiaomai5.com/hades/anon/hades/login', params).then((res) => { BaseService.login(params).then((res) => {
const data = res.data; if (!res.success) {
if (!data.success) { setErrorMessage(res.message);
setErrorMessage(data.message);
} else { } else {
User.setUserId(data.result.userId); User.setUserId(res.result.userId);
User.setToken(data.result.xmToken); User.setToken(res.result.xmToken);
window.RCHistory.push({ window.RCHistory.push({
pathname: `/personal-info`, pathname: `/personal-info`,
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment