提交 239a06c1 authored 作者: 钟是志's avatar 钟是志

// 2023年11月28日 顺哥说的 延职 要传成 include;

上级 1d9ea0a2
......@@ -64,7 +64,7 @@ const errorHandler = (error) => {
*/
const umiRequest = extend({
errorHandler, // 默认错误处理
credentials: 'omit', // 默认请求是否带上cookie
credentials: 'include', // 默认请求是否带上cookie
mode: 'cors',
});
......
......@@ -59,7 +59,7 @@ function getApi(apiUrl) {
Accept: 'application/json',
},
method: 'POST',
credentials: 'omit',
credentials: 'include',
mode: 'cors',
body: formData,
})
......
......@@ -23,7 +23,7 @@ const token = getToken();
const umiRequest = extend({
// errorHandler, // 默认错误处理
credentials: 'omit', // 默认请求是否带上cookie
credentials: 'include', // 默认请求是否带上cookie
mode: 'cors',
});
......
......@@ -163,9 +163,11 @@ export async function request(url, data, options = {}) {
export async function requestOrigin(url, data, options = {}){
export async function requestOrigin(url, data, options = {
credentials: 'include',
}){
console.log(options);
let version = getVersion();
......@@ -194,6 +196,7 @@ export async function requestOrigin(url, data, options = {}){
// method: "POST",
requestType: 'form',
credentials: 'include',
...getHeaders(url),
...options,
......@@ -389,7 +392,7 @@ export const dynamicRequest = createServerRequest({
export const noPrefixRequest = createServerRequest({
method: 'POST',
prefix: '',
credentials: 'omit',
credentials: 'include',
mode: 'cors',
});
......@@ -416,7 +419,7 @@ export const getRequest = createServerRequest({
export const getUiaRequest = (data) => { // 2.0的登录接口
return fetch(queryUiaApi() + '/oauth/token', {
credentials: 'omit',
credentials: 'include',
mode: 'cors',
headers: {
Accept: 'application/json',
......
......@@ -103,7 +103,7 @@ export default class LoginWithQrCode extends Component {
getAppId = () => {
const options = {
body: FormdataWrapper({}),
credentials: 'omit',
credentials: 'include',
mode: 'cors',
method: 'POST',
headers: {
......
......@@ -10,7 +10,7 @@ export default function fetchJSON(url, body) {
return fetch(url, {
method: 'post',
body: JSON.stringify(body),
credentials: 'omit', // 确保浏览器不在请求中包含凭据 // 用这个本地访问北电科会跨域
credentials: 'include', // 确保浏览器不在请求中包含凭据 // 用这个本地访问北电科会跨域
mode: 'cors',
headers: {
'Content-Type': 'application/json',
......
......@@ -91,7 +91,7 @@ export default function requestJson(url, options) {
}
}
const defaultOptions = {
credentials: 'omit',
credentials: 'include',
mode: 'cors',
};
let newOptions = { ...defaultOptions, ...options };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论