Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions packages/comment-widget/src/base-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class BaseForm extends LitElement {
.join('-')
.replaceAll(/-+/g, '-')}`;

return `/console/login?redirect_uri=${encodeURIComponent(window.location.href + parentDomId)}`;
return `/login?redirect_uri=${encodeURIComponent(window.location.pathname + parentDomId)}`;
}

get showCaptcha() {
Expand All @@ -98,25 +98,9 @@ export class BaseForm extends LitElement {
}

async handleLogout() {
if (window.confirm('确定要退出登录吗?')) {
if (window.confirm('点击确定将跳转至退出登录页面,请确保正在编辑的内容已保存。')) {
try {
const response = await fetch(`${this.baseUrl}/logout`, {
method: 'POST',
headers: {
'X-Xsrf-Token':
document.cookie
.split('; ')
.find((row) => row.startsWith('XSRF-TOKEN'))
?.split('=')[1] || '',
},
credentials: 'same-origin',
});

if (!response.ok) {
throw new Error('Failed to logout');
}

window.location.reload();
window.location.href = '/logout';
} catch (error) {
console.error('Failed to logout', error);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
"store.halo.run/app-id": "app-YXyaD"
spec:
enabled: true
requires: ">=2.17.0"
requires: ">=2.20.0"
author:
name: Halo
website: https://github.com/halo-dev
Expand Down