Skip to content

Commit

Permalink
Merge branch 'master' into Feat_1nfrastr
Browse files Browse the repository at this point in the history
  • Loading branch information
timeromantic committed Sep 2, 2019
2 parents 0dca635 + 247e9eb commit 6a10bb3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 27 deletions.
2 changes: 2 additions & 0 deletions App/Server.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func GetTypeInfo(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "%s", `{"Code":1,"Message":"id错误,无该分类数据","Data":[]}`)
return
}
w.Header().Add("Access-Control-Allow-Origin", "*")
fmt.Fprintf(w, "%s", data[0]["str"])
}

Expand All @@ -37,6 +38,7 @@ func GetType(w http.ResponseWriter, r *http.Request) {
}

func GetConfig(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Access-Control-Allow-Origin", "*")
fmt.Fprintf(w, "%s", Config.MySql().Source)
}

Expand Down
1 change: 1 addition & 0 deletions Common/Message.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func (Message Message) Success(message string, data interface{}, w http.Response
if err != nil {
log.Fatal("序列化json错误")
}
w.Header().Add("Access-Control-Allow-Origin", "*")
fmt.Fprintf(w, "%s", string(jsonStr))
}

Expand Down
22 changes: 0 additions & 22 deletions Html/hot.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?7191f97365f98638c50708499114b244";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>

<title>鱼塘热榜</title>

<!-- meta -->
Expand All @@ -30,18 +20,6 @@
<script src="js/pace.min.js"></script>
<script src="js/blog/globalConfig.js"></script>
<script src="js/modernizr.custom.js"></script>
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-140852536-1"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-140852536-1', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
<style>

a:link {
Expand Down
2 changes: 1 addition & 1 deletion Html/js/blog/globalConfig.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const ServerIp = 'https://www.printf520.com:8080'
const ServerIp = 'http://127.0.0.1:9090'
const ImgServerIp = 'https://www.printf520.com'
//
// const ServerIp = 'http://127.0.0.1:8080'
Expand Down
4 changes: 2 additions & 2 deletions Html/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ if ( typeof define === 'function' && define.amd ) {
}
}

triggerBttn.addEventListener( 'click', toggleOverlay );
closeBttn.addEventListener( 'click', toggleOverlay );
triggerBttn && triggerBttn.addEventListener( 'click', toggleOverlay );
closeBttn && closeBttn.addEventListener( 'click', toggleOverlay );
})();
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

### 安装教程


1. 编译

```
Expand All @@ -17,7 +16,7 @@
go build -o ./App/Server App/Server.go
```

2. 执行database.sql创建数据库,更改配置文件`Config/mysql.toml`
2. 创建数据库,如 `news`执行database.sql创建表,更改配置文件`Config/mysql.toml`

3. 编辑文件 `Html/js/blog/globalConfig.js`

Expand All @@ -36,6 +35,7 @@

- 打开`http://{yourdomain}:9090/` 即可访问今日热榜


### 目录说明

```
Expand Down

0 comments on commit 6a10bb3

Please sign in to comment.