mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-08-28 04:20:20 +08:00
48 lines
789 B
Vue
48 lines
789 B
Vue
<template>
|
|
<div>mock and proxy</div>
|
|
</template>
|
|
<config>
|
|
{
|
|
"name": "mock",
|
|
"title": "$mock"
|
|
}
|
|
</config>
|
|
<script setup>
|
|
import { request } from '@fesjs/fes';
|
|
|
|
console.log('测试 mock!!');
|
|
|
|
request('/v2/file')
|
|
.then((data) => {
|
|
console.log(data);
|
|
})
|
|
.catch((err) => {
|
|
console.log(err);
|
|
});
|
|
|
|
request('/v2/movie/in_theaters_mock', { a: 1 }, 'get')
|
|
.then((data) => {
|
|
console.log(data);
|
|
})
|
|
.catch((err) => {
|
|
console.log(err);
|
|
});
|
|
|
|
console.log('测试 proxy!!');
|
|
|
|
request(
|
|
'/v2/movie/in_theaters_proxy',
|
|
{ a: 1 },
|
|
{
|
|
method: 'get',
|
|
headers: { Accept: '*/*' },
|
|
},
|
|
)
|
|
.then((resp) => {
|
|
console.log(resp);
|
|
})
|
|
.catch((err) => {
|
|
console.log(err);
|
|
});
|
|
</script>
|