333
This commit is contained in:
parent
68068c2cb7
commit
935080a7b7
|
|
@ -39,11 +39,12 @@ export const whiteList = [
|
|||
// API白名单(不需要登录即可访问的API)
|
||||
export const apiWhiteList = [
|
||||
'login_record',
|
||||
'api/warehouse_index',
|
||||
'api/user',
|
||||
'api/warehouse_send_record',
|
||||
'api/create_web_pay_order',
|
||||
'api/get_order_url_link'
|
||||
'warehouse_index',
|
||||
'user',
|
||||
'warehouse_send_record',
|
||||
'create_web_pay_order',
|
||||
'get_order_url_link',
|
||||
|
||||
];
|
||||
|
||||
const defaultConfig = {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
import EnvConfig from '@/common/env.js'
|
||||
import md5 from 'js-md5'
|
||||
import CryptoJS from 'crypto-js';
|
||||
import { apiWhiteList } from '@/common/config.js'
|
||||
import { apiWhiteList, whiteList } from '@/common/config.js'
|
||||
import RouterManager from '@/common/router.js'
|
||||
import { platform } from '@/common/platform/PlatformFactory'
|
||||
import { normalizeResponseKeys, getRouteMap } from '@/common/routeMap.js'
|
||||
|
|
@ -77,7 +77,6 @@ class RequestManager {
|
|||
*/
|
||||
static isUrlInWhitelist(url) {
|
||||
|
||||
// 检查URL是否包含白名单中的任一项
|
||||
return apiWhiteList.some(whiteItem => url.indexOf(whiteItem) > -1);
|
||||
}
|
||||
|
||||
|
|
@ -300,13 +299,13 @@ class RequestManager {
|
|||
}
|
||||
|
||||
// 保存重定向URL到缓存
|
||||
console.log('保存重定向URL:', redirectPath);
|
||||
console.log('保存重定向URL:', redirectPath, currentRoute);
|
||||
uni.setStorageSync('redirect', redirectPath);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(requestUrl);
|
||||
if (RequestManager.isUrlInWhitelist(requestUrl)) {
|
||||
if (RequestManager.isUrlInWhitelist(url)) {
|
||||
reject(res.data)
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user