mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
priv (unstable)
This commit is contained in:
1 parent
554698189c
commit
e092efca20
63 files changed
+706
-397
No files matched your search
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "migrate-vijos",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "Migrate From Vijos"
|
||||
}
|
||||
@@ -24,7 +24,7 @@ const tasks = {
|
||||
salt: doc.salt,
|
||||
hash: doc.hash.split('|')[1],
|
||||
hashType: doc.hash.split('|')[0] === 'vj4' ? 'hydro' : doc.hash.split('|')[0],
|
||||
priv: doc.priv === -1 ? 1 : 0,
|
||||
priv: doc.priv,
|
||||
gravatar: doc.gravatar,
|
||||
mail: doc.mail,
|
||||
mailLower: doc.mail_lower,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { Route, Handler } = global.Hydro.service.server;
|
||||
const { PERM_LOGGEDIN } = global.Hydro.permission;
|
||||
const { PRIV: { PRIV_USER_PROFILE } } = global.Hydro.model.builtin;
|
||||
const { pastebin } = global.Hydro.model;
|
||||
const { nav } = global.Hydro.lib;
|
||||
|
||||
@@ -23,10 +23,6 @@ class PasteShowHandler extends Handler {
|
||||
}
|
||||
|
||||
class PasteCreateHandler extends Handler {
|
||||
async prepare() {
|
||||
this.checkPerm(PERM_LOGGEDIN);
|
||||
}
|
||||
|
||||
async get() {
|
||||
const path = [
|
||||
['Hydro', 'homepage'],
|
||||
@@ -49,9 +45,9 @@ class PasteCreateHandler extends Handler {
|
||||
|
||||
async function apply() {
|
||||
Route('pastebin', '/paste', PasteMainHandler);
|
||||
Route('paste_create', '/paste/create', PasteCreateHandler);
|
||||
Route('paste_create', '/paste/create', PasteCreateHandler, PRIV_USER_PROFILE);
|
||||
Route('paste_show', '/paste/:docId', PasteShowHandler);
|
||||
nav('pastebin', null, 'pastebin', PERM_LOGGEDIN);
|
||||
nav('pastebin', null, 'pastebin', PRIV_USER_PROFILE);
|
||||
}
|
||||
|
||||
global.Hydro.handler.pastebin = module.exports = apply;
|
||||
Reference in new issue
Block a user