feat(Details): 新增投票详情页管理功能和评论优化
- 添加投票详情页的管理功能,包括隐藏、推荐、精华和删除操作 - 优化评论组件,支持多图上传和显示 - 新增投币功能组件 - 更新API接口调用方式,适配新后端接口 - 完善用户权限管理逻辑 - 修复样式问题和交互体验
This commit is contained in:
@@ -11,7 +11,7 @@ axios.interceptors.request.use(
|
||||
async (config) => {
|
||||
// 开发时登录用的,可以直接替换小程序的 authorization
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
const miucms_session = "20c7981bcd7b24e373e462ee60a8d326";
|
||||
const miucms_session = "01346a38444d71aaadb3adad52b52c39";
|
||||
document.cookie = "miucms_session=" + miucms_session;
|
||||
config["headers"]["authorization"] = miucms_session;
|
||||
}
|
||||
@@ -98,6 +98,26 @@ const postV2 = (url, params) => {
|
||||
});
|
||||
};
|
||||
|
||||
const del = (url, params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
//是将对象 序列化成URL的形式,以&进行拼接
|
||||
axios
|
||||
.delete(url, params)
|
||||
.then((res) => {
|
||||
let data = res.data;
|
||||
if (data.code == 401 && !process.server) goLogin();
|
||||
resolve(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err.data.code == 401) {
|
||||
goLogin();
|
||||
resolve(err.data);
|
||||
} else reject(err.data);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// 打开登录
|
||||
const goLogin = () => {
|
||||
if (typeof ajax_login === "function") ajax_login();
|
||||
@@ -107,4 +127,5 @@ export default {
|
||||
get,
|
||||
post,
|
||||
postV2,
|
||||
del,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user