mod: 文件名模块修改

This commit is contained in:
张传龙
2022-04-11 22:12:00 +08:00
parent b3aa8147b1
commit 8c1191ece2
4 changed files with 21 additions and 17 deletions

13
src/utils/http/helpers.js Normal file
View File

@@ -0,0 +1,13 @@
import { useUserStore } from '@/store/modules/user'
const WITHOUT_TOKEN_API = [{ url: '/auth/login', method: 'POST' }]
export function isWithoutToken({ url, method = '' }) {
return WITHOUT_TOKEN_API.some((item) => item.url === url && item.method === method.toUpperCase())
}
export function addBaseParams(params) {
if (!params.userId) {
params.userId = useUserStore().userId
}
}