...
|
...
|
@@ -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,
|
...
|
...
|
|