init
This commit is contained in:
192
src/api/index.ts
Normal file
192
src/api/index.ts
Normal file
@@ -0,0 +1,192 @@
|
||||
import {http} from "@/utils/http/axios";
|
||||
import {RequestEnum} from "@/enums/httpEnum";
|
||||
|
||||
|
||||
const baseUrl = '/api'
|
||||
|
||||
/**
|
||||
* @description: getLoansInfo
|
||||
*/
|
||||
export function getLoansInfo() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/home/setting/loans`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: getHomeInfo
|
||||
*/
|
||||
export function getHomeInfo() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/home/setting/home`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: getCalLoan
|
||||
*/
|
||||
export function getCalLoan(data) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/home/loans/calLoan`,
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @description: getLoansUser
|
||||
*/
|
||||
export function getLoansUser() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/home/loans/loansUser`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @description: getUserInfo
|
||||
*/
|
||||
export function getUserInfo() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/customer/card/info`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @description: uploadCommon
|
||||
*/
|
||||
export function uploadCommon(file, onUploadProgress?) {
|
||||
return http.uploadFile({
|
||||
url: `${baseUrl}/v2/common/upload`,
|
||||
method: 'POST',
|
||||
onUploadProgress: (progressEvent) => {
|
||||
onUploadProgress && onUploadProgress(progressEvent)
|
||||
}
|
||||
}, {
|
||||
file: file
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* updateCustomerCard
|
||||
* @param data
|
||||
*/
|
||||
export function updateCustomerCard(data) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/customer/updateCustomerCard`,
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* getBankType
|
||||
*/
|
||||
export function getBankType() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/home/setting/bankType`,
|
||||
method: RequestEnum.GET
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* getBankType
|
||||
*/
|
||||
export function getAgreement() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/home/setting/agreement`,
|
||||
method: RequestEnum.GET
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* getCustomerInfo
|
||||
*/
|
||||
export function getCustomerInfo() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/customer/info`,
|
||||
method: RequestEnum.GET
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getCustomerInfo
|
||||
*/
|
||||
export function getStepBorrow() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/borrow/getStepBorrow`,
|
||||
method: RequestEnum.GET
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getBorrowPage
|
||||
*/
|
||||
export function getBorrowPage(params) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/borrow/page`,
|
||||
method: RequestEnum.GET,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getBorrowInfo
|
||||
*/
|
||||
export function getBorrowInfo(params) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/borrow/info`,
|
||||
method: RequestEnum.GET,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getBorrowWithdraw
|
||||
*/
|
||||
export function getBorrowWithdraw(params) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/borrow/withdraw`,
|
||||
method: RequestEnum.GET,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getSetting
|
||||
*/
|
||||
export function getSetting() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/home/setting/home`,
|
||||
method: RequestEnum.GET
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getSetting
|
||||
*/
|
||||
export function getContract(params?) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/borrow/getContract`,
|
||||
method: RequestEnum.GET,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* startBorrow
|
||||
*/
|
||||
export function startBorrow(data) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/borrow/start`,
|
||||
method: RequestEnum.POST,
|
||||
data
|
||||
});
|
||||
}
|
||||
97
src/api/login/index.ts
Normal file
97
src/api/login/index.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
import { http } from '@/utils/http/axios';
|
||||
|
||||
const baseUrl = '/api'
|
||||
/**
|
||||
* @description: sendSmsRegister
|
||||
*/
|
||||
export function sendSmsRegister(params) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/customer/open/sms/register`,
|
||||
method: 'GET',
|
||||
params
|
||||
},
|
||||
{
|
||||
withToken: false,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @description: sendSmsForget
|
||||
*/
|
||||
export function sendSmsForget(params) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/customer/open/sms/forget`,
|
||||
method: 'GET',
|
||||
params
|
||||
},
|
||||
{
|
||||
withToken: false,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: login
|
||||
*/
|
||||
export function login(data) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/customer/login`,
|
||||
method: 'POST',
|
||||
data
|
||||
},
|
||||
{
|
||||
isTransformResponse: false,
|
||||
withToken: false,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: register
|
||||
*/
|
||||
export function register(data) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/customer/open/register`,
|
||||
method: 'POST',
|
||||
data
|
||||
},
|
||||
{
|
||||
withToken: false,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: updatePwd
|
||||
*/
|
||||
export function updatePwd(data) {
|
||||
return http.request({
|
||||
url: `${baseUrl}/customer/open/updatePwd`,
|
||||
method: 'POST',
|
||||
data
|
||||
},
|
||||
{
|
||||
withToken: false,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description: getUserInfo
|
||||
*/
|
||||
export function getUserInfo() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/customer/info`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 注销账号
|
||||
* @description: closeAmount
|
||||
*/
|
||||
export function closeAmount() {
|
||||
return http.request({
|
||||
url: `${baseUrl}/app/user/close/amount`,
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
0
src/api/system/user.ts
Normal file
0
src/api/system/user.ts
Normal file
Reference in New Issue
Block a user