feat: 删除 Artand, 官方已有源 (#2714)

This commit is contained in:
junbaor
2019-07-30 11:43:49 +08:00
committed by DIYgod
parent 9dfa39d9af
commit b34d69cfea
3 changed files with 0 additions and 51 deletions

View File

@@ -4,12 +4,6 @@ pageClass: routes
# 购物
## Artand
### 用户新作
<Route author="junbaor" example="/artand/user/work/672" path="/artand/user/work/:uid" :paramsDesc="['用户ID, 不太好找, 自行抓包研究吧']"/>
## Westore
### 新品

View File

@@ -1563,9 +1563,6 @@ router.get('/getitfree/search/:keyword?', require('./routes/getitfree/search.js'
// 万联网
router.get('/10000link/news/:category?', require('./routes/10000link/news'));
// Artand
router.get('/artand/user/work/:uid', require('./routes/artand/user/work'));
// 站酷
router.get('/zcool/recommend/:type', require('./routes/zcool/recommend'));
router.get('/zcool/top', require('./routes/zcool/top'));

View File

@@ -1,42 +0,0 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
const uid = ctx.params.uid;
const url = `https://ios2.artand.cn/user1/index?tab=work&uid=${uid}`;
const response = await got({ method: 'get', url });
const dataUser = response.data.user;
const dataList = response.data.list;
const result = await Promise.all(
dataList.map(async (item) => {
const voItem = {
title: item.name,
author: dataUser.uname,
description: '',
pubDate: new Date(item.mtime * 1000).toUTCString(),
link: `https://artand.cn/artid/${Number(item.id) + 100000}`, // +100000 的逻辑挺奇怪
};
const link = 'https://ios2.artand.cn/works/index?post_id=' + item.id;
const cache = await ctx.cache.get(link);
if (cache) {
return Promise.resolve(JSON.parse(cache));
}
const itemReponse = await got.get(link);
voItem.description = itemReponse.data.data.work.desc;
ctx.cache.set(link, JSON.stringify(voItem));
return Promise.resolve(voItem);
})
);
ctx.state.data = {
title: `${dataUser.uname} 的 Artand 新作`,
link: `https://artand.cn/${dataUser.uid}`,
description: `${dataUser.uname} 的 Artand 新作`,
item: result,
};
};