mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-28 11:52:46 +08:00
添加authorid
This commit is contained in:
parent
d17caf42af
commit
6f4bf8fe96
@ -84,7 +84,11 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
disableShare() {
|
||||
return this.shareLock || !this.yuQueInfo.yuQueToken;
|
||||
return (
|
||||
this.shareLock ||
|
||||
!this.yuQueInfo.yuQueToken ||
|
||||
this.yuQueInfo.authorId !== this.command.authorId
|
||||
);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
@ -179,7 +179,8 @@ export default {
|
||||
this.getCommand(
|
||||
item.slug,
|
||||
item.content_updated_at,
|
||||
item.last_editor.name
|
||||
item.last_editor.name,
|
||||
item.last_editor.id
|
||||
).then((command) => {
|
||||
this.commands.push(command);
|
||||
});
|
||||
@ -211,7 +212,7 @@ export default {
|
||||
this.fetchCommandDetails(1);
|
||||
},
|
||||
// 如果远端更新时间和本地相同则读取本地缓存,否则更新
|
||||
async getCommand(id, updateTime, authorName) {
|
||||
async getCommand(id, updateTime, authorName, authorId) {
|
||||
let localCache = JSON.parse(localStorage.getItem(id));
|
||||
if (localCache?.updateTime === updateTime) return localCache;
|
||||
let res = await window.yuQueClient(
|
||||
@ -221,7 +222,7 @@ export default {
|
||||
res.data?.data.body.match(/```json([\s\S]*)```/)?.[1]
|
||||
);
|
||||
if (!command) return;
|
||||
Object.assign(command, { authorName, updateTime });
|
||||
Object.assign(command, { authorName, updateTime, authorId });
|
||||
localStorage.setItem(id, JSON.stringify(command));
|
||||
return command;
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user