mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: support @[user]()
This commit is contained in:
1 parent
b272598685
commit
c5b2552f59
8 files changed
+48
-13
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import { AutoloadPage } from 'vj/misc/Page';
|
||||
import request from 'vj/utils/request';
|
||||
|
||||
export default new AutoloadPage('media', async () => {
|
||||
const items = [];
|
||||
const resolvers = [];
|
||||
const users = $('div[data-user]');
|
||||
users.get().forEach((ele) => {
|
||||
items.push({ type: 'user', id: $(ele).text() });
|
||||
resolvers.push((html) => $(ele).replaceWith($(html)));
|
||||
});
|
||||
if (!items.length) return;
|
||||
const res = await request.post('/media', { items });
|
||||
for (let i = 0; i < res.length; i++) resolvers[i](res[i]);
|
||||
});
|
||||
Reference in new issue
Block a user