Skip to content

Commit a22f88e

Browse files
committed
🎨 b3log#191
1 parent 5857047 commit a22f88e

19 files changed

Lines changed: 24 additions & 36 deletions

File tree

‎console/components/Header.vue‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,7 @@
117117
}
118118
},
119119
async logout () {
120-
// TODO
121-
const responseData = await this.axios.post('/logout')
122-
if (responseData.code === 0) {
123-
window.location.href = 'https://hacpai.com/logout'
124-
} else {
125-
this.commit('setSnackBar', {
126-
snackBar: true,
127-
snackMsg: responseData.msg
128-
})
129-
}
120+
await this.axios.post('/logout')
130121
}
131122
}
132123
}

‎controller/accountctl.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@
1717
package controller
1818

1919
import (
20-
"github.com/b3log/pipe/util"
20+
"net/http"
21+
22+
"github.com/b3log/pipe/model"
2123
"github.com/gin-contrib/sessions"
2224
"github.com/gin-gonic/gin"
23-
"net/http"
2425
)
2526

2627
// logoutAction logout a user.
2728
func logoutAction(c *gin.Context) {
28-
result := util.NewResult()
29-
defer c.JSON(http.StatusOK, result)
30-
3129
session := sessions.Default(c)
3230
session.Options(sessions.Options{
3331
Path: "/",
@@ -37,4 +35,6 @@ func logoutAction(c *gin.Context) {
3735
if err := session.Save(); nil != err {
3836
logger.Errorf("saves session failed: " + err.Error())
3937
}
38+
39+
c.Redirect(http.StatusSeeOther, model.Conf.Server)
4040
}

‎pipe.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Server": "http://localhost:5897",
33
"StaticServer": "",
4-
"StaticResourceVersion": "1548907152396",
4+
"StaticResourceVersion": "1549268687098",
55
"OpenRegister": true,
66
"RuntimeMode": "dev",
77
"LogLevel": "debug",

‎theme/js/common.js‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @fileoverview common tool for every theme
33
*
44
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
5-
* @version 0.4.0.1, Oct 31, 2018
5+
* @version 0.4.0.2, Feb 4, 2019
66
*/
77

88
import $ from 'jquery'
@@ -242,10 +242,7 @@ export const KillBrowser = () => {
242242
export const Logout = () => {
243243
$.ajax({
244244
url: `${config.Server}/api/logout`,
245-
type: 'POST',
246-
success: (result) => {
247-
window.location.href = 'https://hacpai.com/logout'
248-
}
245+
type: 'POST'
249246
})
250247
}
251248

‎theme/sw.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/9IPHP/js/article.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/9IPHP/js/common.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/Fara/js/article.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/Fara/js/common.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/Gina/js/article.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)