首页登录完成
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import axios from '../config/axiosConfig'
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
axios.interceptors.response.use((response)=>{
|
||||
return response.data;
|
||||
@@ -7,11 +6,11 @@ axios.interceptors.response.use((response)=>{
|
||||
return error;
|
||||
})
|
||||
|
||||
function get(url: string,data?: object): Promise<AxiosPromise> {
|
||||
function get(url: string,data?: object) {
|
||||
return axios.get(url,{params:data})
|
||||
}
|
||||
|
||||
function post(url: string,data?: object): Promise<AxiosPromise> {
|
||||
function post(url: string,data?: object) {
|
||||
return axios.post(url,data)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { get, post } from './base'
|
||||
import { AxiosPromise } from 'axios'
|
||||
|
||||
/**
|
||||
* 请求验证码
|
||||
@@ -7,32 +6,10 @@ import { AxiosPromise } from 'axios'
|
||||
* @param type 类型 0国内 1国外
|
||||
*/
|
||||
|
||||
export function sendsms(phone: string, type?: number): Promise<AxiosPromise>{
|
||||
export function sendsms(phone: string, type?: number){
|
||||
return post('SendSms',{phone, type})
|
||||
}
|
||||
|
||||
export function loginpass(phone: string, password: string): Promise<AxiosPromise>{
|
||||
export function loginpass(phone: string, password: string){
|
||||
return post("login",{type: 2,username: phone, password: password})
|
||||
}
|
||||
|
||||
|
||||
// 下面是示例接口 可以删除
|
||||
|
||||
/**
|
||||
* 请求用户信息
|
||||
*/
|
||||
|
||||
export function getinfo(): Promise<AxiosPromise>{
|
||||
return get("a")
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交修改之后的用户信息
|
||||
* @param data
|
||||
*
|
||||
*/
|
||||
|
||||
export function seninfo(data: object): Promise<AxiosPromise>{
|
||||
return post("b",data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user