File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export class BaseForm extends LitElement {
71
71
. join ( '-' )
72
72
. replaceAll ( / - + / g, '-' ) } `;
73
73
74
- return `/console/ login?redirect_uri=${ encodeURIComponent ( window . location . href + parentDomId ) } ` ;
74
+ return `/login?redirect_uri=${ encodeURIComponent ( window . location . pathname + parentDomId ) } ` ;
75
75
}
76
76
77
77
get showCaptcha ( ) {
@@ -98,25 +98,9 @@ export class BaseForm extends LitElement {
98
98
}
99
99
100
100
async handleLogout ( ) {
101
- if ( window . confirm ( '确定要退出登录吗? ' ) ) {
101
+ if ( window . confirm ( '点击确定将跳转至退出登录页面,请确保正在编辑的内容已保存。 ' ) ) {
102
102
try {
103
- const response = await fetch ( `${ this . baseUrl } /logout` , {
104
- method : 'POST' ,
105
- headers : {
106
- 'X-Xsrf-Token' :
107
- document . cookie
108
- . split ( '; ' )
109
- . find ( ( row ) => row . startsWith ( 'XSRF-TOKEN' ) )
110
- ?. split ( '=' ) [ 1 ] || '' ,
111
- } ,
112
- credentials : 'same-origin' ,
113
- } ) ;
114
-
115
- if ( ! response . ok ) {
116
- throw new Error ( 'Failed to logout' ) ;
117
- }
118
-
119
- window . location . reload ( ) ;
103
+ window . location . href = '/logout' ;
120
104
} catch ( error ) {
121
105
console . error ( 'Failed to logout' , error ) ;
122
106
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ metadata:
8
8
" store.halo.run/app-id " : " app-YXyaD"
9
9
spec :
10
10
enabled : true
11
- requires : " >=2.17 .0"
11
+ requires : " >=2.20 .0"
12
12
author :
13
13
name : Halo
14
14
website : https://github.com/halo-dev
You can’t perform that action at this time.
0 commit comments