Authored by 周少峰

Merge branch 'feature/keywords'

... ... @@ -15,10 +15,6 @@ const TYPE_LIST = [
];
const tdk = {
_getDeaultList: async(ctx, next) => {
},
// tdk 列表
index: async(ctx, next) => {
let resData = {};
... ... @@ -115,7 +111,12 @@ const tdk = {
return ctx.response.body = result;
}
let hashKey = type === 'url' ? md5(key) : key;
let hashKey = key;
if (type === 'url') {
key = _.replace(key, /http[s]?:\/\//, '');
hashKey = md5(key);
}
await ctx.redis.multi([
['lpushx', `tdk:${type}:links`, hashKey],
... ... @@ -150,7 +151,12 @@ const tdk = {
return ctx.response.body = result;
}
let hashKey = type === 'url' ? md5(key) : key;
let hashKey = key;
if (type === 'url') {
key = _.replace(key, /http[s]?:\/\//, '');
hashKey = md5(key);
}
await ctx.redis.multi([
['hmset', `tdk:${type}:${hashKey}`, 'title', title, 'keywords', keywords,
... ...
... ... @@ -293,8 +293,6 @@
data = that.packReqData();
data.key = data.key.replace(/http[s]?:\/\//,'');
if (!data) {
that.$errTip.text('请填写完整tdk信息');
return;
... ...