mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
更换socket鉴权方式
This commit is contained in:
1 parent
8bb389eedd
commit
b9076cd5d3
7 files changed
+61
-59
No files matched your search
@@ -62,10 +62,7 @@ class DiscussionHandler extends Handler {
|
||||
// TODO(twd2): exclude problem/contest discussions?
|
||||
// TODO(iceboy): continuation based pagination.
|
||||
if (ObjectID.isValid(name)) name = new ObjectID(name);
|
||||
this.vnode = await discussion.getVnode(domainId, {
|
||||
parentType: typeMapper[type],
|
||||
parentId: name,
|
||||
}, this);
|
||||
this.vnode = await discussion.getVnode(domainId, typeMapper[type], name, this);
|
||||
if (this.ddoc) {
|
||||
this.ddoc.parentType = this.ddoc.parentType || this.vnode.type;
|
||||
this.ddoc.parentId = this.ddoc.parentId || this.vnode.id;
|
||||
|
||||
@@ -102,12 +102,6 @@ class SwitchLanguageHandler extends Handler {
|
||||
}
|
||||
}
|
||||
|
||||
class SockToken extends Handler {
|
||||
async get() {
|
||||
this.response.body = { token: this.UIContext.token };
|
||||
}
|
||||
}
|
||||
|
||||
class UiSettingsHandler extends Handler {
|
||||
async get() {
|
||||
const [
|
||||
@@ -143,7 +137,6 @@ export async function apply() {
|
||||
Route('status', '/status', StatusHandler);
|
||||
Route('status_update', '/status/update', StatusUpdateHandler);
|
||||
Route('switch_language', '/language/:lang', SwitchLanguageHandler);
|
||||
Route('token', '/token', SockToken);
|
||||
Route('ui', '/extra.css', UiSettingsHandler);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user