修复添加ck,初始化目录缺失

This commit is contained in:
whyour
2021-04-16 19:32:27 +08:00
parent 0563555a6a
commit ac5e2e404e
6 changed files with 13 additions and 10 deletions
+3 -2
View File
@@ -122,14 +122,15 @@ export default class CookieService {
}
public async create(payload: string[]): Promise<Cookie[]> {
const cookies = await this.cookies('', { postion: 1 });
const cookies = await this.cookies('');
let position = initCookiePosition;
if (cookies && cookies.length > 0) {
position = cookies[0].position / 2;
position = cookies[cookies.length - 1].position;
}
const tabs = payload.map((x) => {
const cookie = new Cookie({ value: x, position });
position = position / 2;
cookie.position = position;
return cookie;
});
const docs = await this.insert(tabs);