Skip to content

Commit ad2a4cb

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # pipe.json # theme/x/9IPHP/css/common.css # theme/x/Fara/css/common.css # theme/x/Gina/css/common.css # theme/x/Koma/css/common.css # theme/x/Littlewin/css/common.css # theme/x/Medium/css/common.css # theme/x/Next/css/common.css
2 parents 11fe860 + 1dadfe7 commit ad2a4cb

26 files changed

+76
-56
lines changed

controller/oauthctl.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func loginCallbackAction(c *gin.Context) {
6565
user = &model.User{
6666
Name: userName,
6767
AvatarURL: avatar,
68-
B3Key: githubId,
68+
B3Key: userName,
6969
GithubId: githubId,
7070
}
7171

@@ -81,7 +81,7 @@ func loginCallbackAction(c *gin.Context) {
8181
user = &model.User{
8282
Name: userName,
8383
AvatarURL: avatar,
84-
B3Key: githubId,
84+
B3Key: userName,
8585
GithubId: githubId,
8686
}
8787

@@ -93,11 +93,24 @@ func loginCallbackAction(c *gin.Context) {
9393
}
9494
} else {
9595
user.GithubId = githubId
96-
user.B3Key = githubId
9796
user.AvatarURL = avatar
98-
service.User.UpdateUser(user)
97+
if err := service.User.UpdateUser(user); nil != err {
98+
logger.Errorf("update user failed: " + err.Error())
99+
c.Status(http.StatusInternalServerError)
100+
101+
return
102+
}
99103
}
100104
}
105+
} else {
106+
user.Name = userName
107+
user.AvatarURL = avatar
108+
if err := service.User.UpdateUser(user); nil != err {
109+
logger.Errorf("update user failed: " + err.Error())
110+
c.Status(http.StatusInternalServerError)
111+
112+
return
113+
}
101114
}
102115

103116
ownBlog := service.User.GetOwnBlog(user.ID)

go.mod

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,43 @@ module github.com/88250/pipe
33
go 1.12
44

55
require (
6-
cloud.google.com/go v0.37.1 // indirect
76
github.com/88250/gulu v0.0.0-20191221090949-7ec528e17061
8-
github.com/88250/lute v0.0.0-20191230154728-ed9c8978a4e5
7+
github.com/88250/lute v0.0.0-20200109164411-d82a2ba83be0
98
github.com/PuerkitoBio/goquery v1.5.0
10-
github.com/araddon/dateparse v0.0.0-20190223010137-262228af701e
9+
github.com/andybalholm/cascadia v1.1.0 // indirect
10+
github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195
1111
github.com/beevik/etree v1.1.0 // indirect
12-
github.com/bluele/gcache v0.0.0-20190301044115-79ae3b2d8680
12+
github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833
1313
github.com/clbanning/mxj v1.8.4 // indirect
14-
github.com/denisenkom/go-mssqldb v0.0.0-20190315220205-a8ed825ac853 // indirect
14+
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73 // indirect
1515
github.com/dustin/go-humanize v1.0.0
16-
github.com/elazarl/goproxy v0.0.0-20181111060418-2ce16c963a8a // indirect
17-
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect
16+
github.com/elazarl/goproxy v0.0.0-20191011121108-aa519ddbe484 // indirect
17+
github.com/elazarl/goproxy/ext v0.0.0-20191011121108-aa519ddbe484 // indirect
1818
github.com/fatih/structs v1.1.0
19-
github.com/gin-contrib/sessions v0.0.0-20190226023029-1532893d996f
20-
github.com/gin-gonic/gin v1.3.0
21-
github.com/go-sql-driver/mysql v1.4.1 // indirect
22-
github.com/gofrs/uuid v3.2.0+incompatible // indirect
23-
github.com/gorilla/feeds v1.1.0
19+
github.com/gin-contrib/sessions v0.0.3
20+
github.com/gin-gonic/gin v1.5.0
21+
github.com/go-playground/universal-translator v0.17.0 // indirect
22+
github.com/go-sql-driver/mysql v1.5.0 // indirect
23+
github.com/gorilla/feeds v1.1.1
24+
github.com/gorilla/sessions v1.2.0 // indirect
2425
github.com/ikeikeikeike/go-sitemap-generator v2.0.1+incompatible
25-
github.com/jinzhu/gorm v1.9.2
26-
github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a // indirect
27-
github.com/jinzhu/now v1.0.0 // indirect
28-
github.com/lib/pq v1.0.0 // indirect
29-
github.com/mattn/go-isatty v0.0.11 // indirect
30-
github.com/mattn/go-sqlite3 v1.10.0 // indirect
26+
github.com/jinzhu/gorm v1.9.12
27+
github.com/jinzhu/now v1.1.1 // indirect
28+
github.com/json-iterator/go v1.1.9 // indirect
29+
github.com/leodido/go-urn v1.2.0 // indirect
30+
github.com/lib/pq v1.3.0 // indirect
31+
github.com/mattn/go-sqlite3 v2.0.2+incompatible // indirect
3132
github.com/microcosm-cc/bluemonday v1.0.2
32-
github.com/moul/http2curl v1.0.0 // indirect
33-
github.com/mssola/user_agent v0.5.0
34-
github.com/parnurzeal/gorequest v0.2.15
35-
github.com/sergi/go-diff v1.1.0 // indirect
36-
github.com/simplereach/timeutils v1.2.0 // indirect
37-
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff // indirect
33+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
34+
github.com/modern-go/reflect2 v1.0.1 // indirect
35+
github.com/mssola/user_agent v0.5.1
36+
github.com/parnurzeal/gorequest v0.2.16
37+
github.com/smartystreets/assertions v1.0.1 // indirect
38+
github.com/smartystreets/goconvey v1.6.4 // indirect
3839
github.com/vinta/pangu v3.0.0+incompatible
39-
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 // indirect
40+
golang.org/x/crypto v0.0.0-20200109152110-61a87790db17 // indirect
4041
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect
41-
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
42-
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 // indirect
43-
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce // indirect
42+
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
4443
gopkg.in/yaml.v2 v2.2.7
44+
moul.io/http2curl v1.0.0 // indirect
4545
)

theme/js/common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import $ from 'jquery'
99
import NProgress from 'nprogress'
1010
import pjax from './lib/pjax'
11+
import Uvstat from 'uvstat'
1112

1213
export const ParseHljs = () => {
1314
Vditor.highlightRender({

theme/package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

theme/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"jquery": "^3.4.1",
4444
"nprogress": "^0.2.0",
4545
"qrious": "^4.0.2",
46-
"turndown": "^5.0.3"
46+
"turndown": "^5.0.3",
47+
"uvstat": "^1.0.4"
4748
}
4849
}

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/article.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h2 class="article__title">
4040
&nbsp; | &nbsp;
4141
<span class="ft__nowrap">
4242
<svg><use xlink:href="#icon-view"></use></svg>
43-
{{.Article.ViewCount}} {{$.I18n.View}}
43+
<span data-uvstaturl="{{.Article.URL}}">{{.Article.ViewCount}}</span> {{$.I18n.View}}
4444
</span>
4545
{{if and .Commentable (gt .Article.CommentCount 0)}}
4646
&nbsp; | &nbsp;

theme/x/9IPHP/define-article-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ <h2 class="article__title">
4545
&nbsp; | &nbsp;
4646
<span class="ft__nowrap">
4747
<svg><use xlink:href="#icon-view"></use></svg>
48-
{{.ViewCount}} {{$.I18n.View}}
48+
<span data-uvstaturl="{{.URL}}">{{.ViewCount}}</span> {{$.I18n.View}}
4949
</span>
5050
{{if and $.Commentable (gt .CommentCount 0)}}
5151
&nbsp; | &nbsp;

theme/x/9IPHP/define-footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</div>
1010
</div>
1111
<div class="fn__clear">
12-
{{.Statistic.StatisticViewCount}}
12+
<span data-uvstaturl="{{.BlogURL}}">{{.Statistic.StatisticViewCount}}</span>
1313
{{.I18n.View}}
1414
&nbsp;
1515
{{.Statistic.StatisticArticleCount}}

theme/x/Fara/article.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h1 class="article__title">
3232
{{.Article.Author.Name}}
3333
</a>
3434
{{end}}
35-
, {{.Article.ViewCount}} {{$.I18n.View}}
35+
, <span data-uvstaturl="{{.Article.URL}}">{{.Article.ViewCount}}</span> {{$.I18n.View}}
3636
{{if and $.Commentable (gt .Article.CommentCount 0)}}
3737
,
3838
<a href="{{.Article.URL}}#pipeComments">

0 commit comments

Comments
 (0)