fix: 修复删除接口参数传递和更新开发环境session token
修复删除接口参数传递方式,将params作为配置对象传递而非直接传递。同时更新开发环境使用的session token值以匹配最新要求。
This commit is contained in:
@@ -830,7 +830,7 @@ const essence = () => {
|
|||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
const deleteItem = () => {
|
const deleteItem = () => {
|
||||||
managerDelete(token)
|
managerDelete(topicToken.value)
|
||||||
.then(() => redirectToExternalWebsite("/", "_self"))
|
.then(() => redirectToExternalWebsite("/", "_self"))
|
||||||
.finally(() => cutShow());
|
.finally(() => cutShow());
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ axios.interceptors.request.use(
|
|||||||
async (config) => {
|
async (config) => {
|
||||||
// 开发时登录用的,可以直接替换小程序的 authorization
|
// 开发时登录用的,可以直接替换小程序的 authorization
|
||||||
if (process.env.NODE_ENV !== "production") {
|
if (process.env.NODE_ENV !== "production") {
|
||||||
const miucms_session = "3b01343c65e3b2fa3ce32ae26feb3a9b";
|
const miucms_session = "jyuemtAxi3A8drVrTxwpgYp2ibmSxHq0cRs1vzXl";
|
||||||
document.cookie = "miucms_session=" + miucms_session;
|
document.cookie = "miucms_session=" + miucms_session;
|
||||||
config["headers"]["authorization"] = miucms_session;
|
config["headers"]["authorization"] = miucms_session;
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ const del = (url, params) => {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
//是将对象 序列化成URL的形式,以&进行拼接
|
//是将对象 序列化成URL的形式,以&进行拼接
|
||||||
axios
|
axios
|
||||||
.delete(url, params)
|
.delete(url, { params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data.code == 401 && !process.server) goLogin();
|
if (data.code == 401 && !process.server) goLogin();
|
||||||
@@ -117,7 +117,6 @@ const del = (url, params) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 打开登录
|
// 打开登录
|
||||||
const goLogin = () => {
|
const goLogin = () => {
|
||||||
if (typeof ajax_login === "function") ajax_login();
|
if (typeof ajax_login === "function") ajax_login();
|
||||||
|
|||||||
Reference in New Issue
Block a user