Skip to content

Commit

Permalink
🐛 fixed theme setting save error
Browse files Browse the repository at this point in the history
  • Loading branch information
hellokaton committed Aug 15, 2018
1 parent baf161a commit 61dc113
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public String setting(Request request) {
if (StringKit.isNotBlank(option)) {
map = (Map<String, Object>) JsonKit.toAson(option);
}
request.attribute("theme_options", map);
request.attribute("options", map);
} catch (Exception e) {
log.error("解析主题设置出现异常", e);
}
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/com/tale/task/PageViewTask.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.tale.task;

import com.blade.ioc.annotation.Bean;
import com.blade.task.annotation.Schedule;
import io.github.biezhi.anima.Anima;

import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;

/**
* 定时刷新 PV 到数据库
*
* @author biezhi
* @date 2018/8/13
*/
@Bean
public class PageViewTask {

// public static Map<Long, AtomicLong> counts = new ConcurrentHashMap<>();
//
// @Schedule(cron = "*/5 * * * * ?")
// public void syncToDB() {
// Set<Long> cids = counts.keySet();
// for (Long cid : cids) {
// long count = counts.get(cid).getAndSet(0);
// Anima.execute("update contents set hits = hits + " + count + " where cid = " + cid);
// }
// }

}
4 changes: 2 additions & 2 deletions src/main/resources/templates/comm/ts_base_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
function saveThemeOptions(formId) {
var param = $('#' + formId).serialize();
tale.post({
url : '/admin/themes/setting',
url : '/admin/api/themes/setting',
data: param,
success: function (result) {
if(result && result.success){
Expand All @@ -31,7 +31,7 @@
function saveIndiviSetting() {
var param = $('#indivi-form').serialize();
tale.post({
url : '/admin/setting',
url : '/admin/api/themes/setting',
data: param,
success: function (result) {
if(result && result.success){
Expand Down

0 comments on commit 61dc113

Please sign in to comment.