mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: fix defaultPriv edit (#444)
Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
1 parent
e964eec099
commit
a230d1c7c3
5 files changed
+39
-38
No files matched your search
@@ -20,10 +20,11 @@ const page = new NamedPage('manage_user_priv', () => {
|
||||
|
||||
async function changeUserPriv(uid, priv) {
|
||||
try {
|
||||
const res = await request.post('', uid !== 'default' ? {
|
||||
uid,
|
||||
const res = await request.post('', {
|
||||
uid: uid !== 'default' ? uid : 0,
|
||||
priv,
|
||||
} : { priv });
|
||||
system: uid === 'default',
|
||||
});
|
||||
if (res.url && res.url !== window.location.href) window.location.href = res.url;
|
||||
else {
|
||||
Notification.success(i18n('Priv has been updated to {0}.', priv));
|
||||
@@ -54,8 +55,8 @@ const page = new NamedPage('manage_user_priv', () => {
|
||||
handleOpenUserPrivDialog(user.udoc);
|
||||
}
|
||||
|
||||
$('[name="select_user"]').on('click', () => handleClickSelectUser());
|
||||
$('[name="set_priv"]').on('click', (ev) => handleOpenUserPrivDialog(ev));
|
||||
$(document).on('click', '[name="select_user"]', () => handleClickSelectUser());
|
||||
$(document).on('click', '[name="set_priv"]', (ev) => handleOpenUserPrivDialog(ev));
|
||||
});
|
||||
|
||||
export default page;
|
||||
Reference in new issue
Block a user