feat: 客服接口mock添加
This commit is contained in:
22
src/mocks/handlers/bytedesk.js
Normal file
22
src/mocks/handlers/bytedesk.js
Normal file
@@ -0,0 +1,22 @@
|
||||
// src/mocks/handlers/bytedesk.js
|
||||
/**
|
||||
* Bytedesk 客服 Widget MSW Handler
|
||||
* 使用 passthrough 让请求通过到真实服务器,消除 MSW 警告
|
||||
*/
|
||||
|
||||
import { http, passthrough } from 'msw';
|
||||
|
||||
export const bytedeskHandlers = [
|
||||
// Bytedesk API 请求 - 直接 passthrough
|
||||
// 匹配 /bytedesk/* 路径(通过代理访问后端)
|
||||
http.all('/bytedesk/*', () => {
|
||||
return passthrough();
|
||||
}),
|
||||
|
||||
// Bytedesk 外部 CDN/服务请求
|
||||
http.all('https://www.weiyuai.cn/*', () => {
|
||||
return passthrough();
|
||||
}),
|
||||
];
|
||||
|
||||
export default bytedeskHandlers;
|
||||
Reference in New Issue
Block a user