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