Commit 8f84ec1f by zhangleyuan

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

parent eeef05cd
......@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-12-01 17:21:21
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-08 10:38:04
* @LastEditTime: 2020-12-11 11:53:13
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -10,8 +10,7 @@ import Service from "@/common/js/service";
export function getUserStore(params: object) {
return Service.Hades("public/hades/getUserStore", params);
}
}
export function getUserPermission(params: object) {
return Service.Hades("public/hades/getPermission", params);
}
......@@ -34,4 +33,9 @@ export function sendNewPhoneAuthCode(params: object) {
export function editUserPhone(params: object) {
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 @@
* @Author: wufan
* @Date: 2020-12-01 17:20:49
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-07 11:08:23
* @LastEditTime: 2020-12-11 11:50:17
* @Description: Description
* @@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 {
// 获取员工列表
......@@ -40,4 +40,10 @@ export default class StoreService {
static sendNewPhoneAuthCode(params: any){
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';
import {Input,Popover,message} from 'antd';
import CheckBeforeSendCode from '../../components/CheckBeforeSendCode';
import User from '@/common/js/user';
import BaseService from "@/domains/basic-domain/baseService";
import axios from 'axios';
import _ from 'underscore';
......@@ -19,9 +20,6 @@ function Login(props) {
const [errorMessage,setErrorMessage] = useState('');
const [phoneError,setPhoneError] = useState(false);
const [checkObject1, setCheckObject1] = useState({});
useEffect(() => {
}, [])
async function checkAccount(code, callback = () => { }) {
callback();
......@@ -52,9 +50,9 @@ function Login(props) {
serverType: "CLOUD_CLASS_LOGIN",
appTermEnum:'XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN'
}
axios.post('https://dev-heimdall.xiaomai5.com/hades/anon/hades/sendLoginAuthCode', params).then((res) => {
if (!res.data.success) {
setErrorMessage(res.data.message);
BaseService.sendLoginAuthCode(params).then((res) => {
if (!res.success) {
setErrorMessage(res.message);
} else {
timeSub(60);
setChecking1(true)
......@@ -87,13 +85,12 @@ function Login(props) {
authCode:phoneverify,
appTermEnum:"XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN"
}
axios.post('https://dev-heimdall.xiaomai5.com/hades/anon/hades/login', params).then((res) => {
const data = res.data;
if (!data.success) {
setErrorMessage(data.message);
BaseService.login(params).then((res) => {
if (!res.success) {
setErrorMessage(res.message);
} else {
User.setUserId(data.result.userId);
User.setToken(data.result.xmToken);
User.setUserId(res.result.userId);
User.setToken(res.result.xmToken);
window.RCHistory.push({
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