1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-11 12:49:30 +08:00

新增:私密分类的访问

This commit is contained in:
cuolv
2023-08-02 05:30:13 +00:00
committed by Gitee
parent f838da43d8
commit f6feecb324
2 changed files with 68 additions and 17 deletions
+3
View File
@@ -4,6 +4,7 @@
*/
import HttpHandler from '@/common/http/request.js'
import { getCache } from '@/utils/storage.js'
export default {
/**
* 查询分类列表
@@ -19,6 +20,8 @@ export default {
* @param {Object} params 查询参数
*/
getCategoryPostList: (slug, params) => {
// 从缓存中根据分类获取密码,如果获取到了说明本分类需要密码,避免多个分类需要密码在输入密码后刷新页面点错了分类
params.password = getCache('APP_CATEGORY_PWD_' + slug)
return HttpHandler.Get(`/api/content/categories/${slug}/posts`, params)
},
}