调整登录逻辑
This commit is contained in:
@@ -30,7 +30,6 @@ const request = async function (options, config = {}) {
|
||||
"env": envVersion,
|
||||
...config
|
||||
};
|
||||
console.log('config', config)
|
||||
let response;
|
||||
try {
|
||||
response = await requestWithoutCookie(options);
|
||||
@@ -47,12 +46,10 @@ const request = async function (options, config = {}) {
|
||||
|
||||
if (localCookieString) {
|
||||
const localCookies = localCookieString.split('; ');
|
||||
|
||||
for (const localCookie of localCookies) {
|
||||
const matchResult = localCookie.match(/^([^=]+)=(.+)/);
|
||||
cookieMap[matchResult[1]] = matchResult[2];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const matchResultSet = setCookie.match(/^([^=]+)=([^;]+);/);
|
||||
@@ -76,7 +73,6 @@ const request = async function (options, config = {}) {
|
||||
alertInfo(err.errMsg)
|
||||
}
|
||||
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -111,8 +107,6 @@ const GET = async function (uri) {
|
||||
const response = await request({
|
||||
url: `${SERVER}${uri}`,
|
||||
method: 'GET'
|
||||
}, {
|
||||
"content-type": "image/png"
|
||||
});
|
||||
|
||||
return parseResponse(response);
|
||||
@@ -120,9 +114,7 @@ const GET = async function (uri) {
|
||||
|
||||
// 创建、更新和删除请求
|
||||
const CUD = async function (method, uri, data = null) {
|
||||
|
||||
// 没有CSRF Token就前往获取
|
||||
|
||||
// 请求参数
|
||||
const options = {
|
||||
url: `${SERVER}${uri}`,
|
||||
@@ -159,4 +151,4 @@ export default {
|
||||
RAW_SERVER,
|
||||
api,
|
||||
OK: ok
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user