🐞 fix:解决mock问题
This commit is contained in:
parent
12f2274971
commit
855f64b21c
|
@ -1,6 +1,6 @@
|
|||
import sdy from './modules/sdy'
|
||||
import ycy from './modules/ycy'
|
||||
export default [
|
||||
...SDY,
|
||||
...YCY
|
||||
...sdy,
|
||||
...ycy
|
||||
]
|
|
@ -16,7 +16,7 @@ const StockList = Mock.mock({
|
|||
|
||||
export default [
|
||||
{
|
||||
url: "/stockList",
|
||||
url: "/api/stockList",
|
||||
method: "get",
|
||||
response: () => {
|
||||
const obj = {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// 进行axios二次封装:使用请求与响应拦截器
|
||||
import axios from "axios";
|
||||
import { MessagePlugin } from "tdesign-vue-next";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
// 第一步:利用axios对象的create方法,去创建axios实例(其他的配置:基础的路径、超时的时间)
|
||||
const request = axios.create({
|
||||
|
@ -10,8 +9,6 @@ const request = axios.create({
|
|||
});
|
||||
// 第二步:axios实例添加请求与响应拦截器
|
||||
request.interceptors.request.use((config) => {
|
||||
// config配置对象,headers属性请求头,经常给服务器端携带公共参数
|
||||
// 返回配置对象
|
||||
return config;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user