鏡像自
https://github.com/ialley-workshop-open/uni-halo.git
已同步 2026-06-12 13:19:31 +08:00
1. 修复文章密码访问失效问题
此提交包含在:
@@ -161,6 +161,19 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验文章访问密码
|
||||||
|
*/
|
||||||
|
checkPostPasswordAccess: (password, postId) => {
|
||||||
|
return HttpHandler.Get(`/apis/tools.muyin.site/v1alpha1/visitPassword/checkPost?password=${password}`, null, {
|
||||||
|
header: {
|
||||||
|
'Authorization': HaloPluginsConfig.toolsPlugin.Authorization,
|
||||||
|
'Wechat-Session-Id': uni.getStorageSync('openid'),
|
||||||
|
'Post-Id': postId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取文章验证码
|
* 获取文章验证码
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -375,6 +375,9 @@ export default {
|
|||||||
this.visitType = 3;
|
this.visitType = 3;
|
||||||
this.visitPwd = annotationsMap.unihalo_useVisitPwd;
|
this.visitPwd = annotationsMap.unihalo_useVisitPwd;
|
||||||
this.showValidVisitPop();
|
this.showValidVisitPop();
|
||||||
|
} else if (('restrictReadEnable' in annotationsMap) && annotationsMap.restrictReadEnable === 'password') {
|
||||||
|
this.visitType = 4;
|
||||||
|
this.showValidVisitPop();
|
||||||
} else {
|
} else {
|
||||||
this.visitType = 0;
|
this.visitType = 0;
|
||||||
this.showValidVisitMore = false;
|
this.showValidVisitMore = false;
|
||||||
@@ -856,6 +859,9 @@ export default {
|
|||||||
const first30PercentRaw = this.result?.content?.raw?.substring(0, first30PercentLength);
|
const first30PercentRaw = this.result?.content?.raw?.substring(0, first30PercentLength);
|
||||||
this.result.content.raw = first30PercentRaw;
|
this.result.content.raw = first30PercentRaw;
|
||||||
return;
|
return;
|
||||||
|
case 4:
|
||||||
|
this.result.content.raw = "";
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -894,6 +900,22 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
case 4:
|
||||||
|
this.$httpApi.v2.checkPostPasswordAccess(this.validVisitModal.value, this.result?.metadata?.name).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.setStorageSync('visit_' + this.result?.metadata?.name, true)
|
||||||
|
this.closeAllPop();
|
||||||
|
this.fnGetData();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '密码错误',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
新增問題並參考
封鎖使用者