22-11-11 天气多云

1

本来想将博客搭建到服务器上,但是出现了很多问题没有解决

错误 1

1
Permission denied, please try again

在服务器创建用户后,用这个用户连接,没有权限,不知道怎么解决,后面用 root 直接连接,把博客文件传到服务器,但是不能用公网 ip 访问。

错误 2

1
Please make sure you have the correct access rights and the repository exists.

错误 3

1
2
3
4
5
6
7
8
9
FATAL {
err: Error: Spawn failed
at ChildProcess.<anonymous> (E:\BKXM\bk\blog-demo\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (node:events:527:28)
at ChildProcess.cp.emit (E:\BKXM\bk\blog-demo\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
code: 128
}
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

错误 3 解决方法

1
2
3
删除名为.deploy_git的文件夹,rm -rf .deploy_git
git config --global core.autocrlf false
hexo c;hexo g;hexo d

最后直接在 GitHub 拉取文件,可以用公网 ip 访问,但是不能实时更新,需要手动拉去 GitHub 文件

http://43.139.12.60/
hehao.love
heha001.github.io

2

论文进度++
@Controller
@RequestMapping(“/blog/bContent”)
public class ContentController extends BaseController {
@Autowired
ContentService bContentService;
@Autowired
private CategoryInfoService categoryInfoService;
@GetMapping()
String bContent() {
return “blog/bContent/bContent”;
}

@ResponseBody
@GetMapping(“/list”)
public PageUtils list(@RequestParam Map<String, Object> params) {
params.put(“created”,getUserId());
Query query = new Query(params);
List bContentList = bContentService.list(query);
int total = bContentService.count(query);
PageUtils pageUtils = new PageUtils(bContentList, total);
return pageUtils;
}
@GetMapping(“/add”)
String add(Model model) {
Map<String, Object> params = new HashMap<>();
params.put(“deleted”,0);
List categoryInfoList = categoryInfoService.list(params);
model.addAttribute(“categoryInfoList”, categoryInfoList);
return “blog/bContent/add”;
}
@GetMapping(“/edit/{cid}”)
String edit(@PathVariable(“cid”) Long cid, Model model) {
ContentDO bContentDO = bContentService.get(cid);
model.addAttribute(“bContent”, bContentDO);
Map<String, Object> params = new HashMap<>();
params.put(“deleted”,0);
List categoryInfoList = categoryInfoService.list(params);
model.addAttribute(“categoryInfoList”, categoryInfoList);
return “blog/bContent/edit”;
}
@GetMapping(“/add0”)
String add0(Model model) {
Map<String, Object> params = new HashMap<>();
params.put(“deleted”,0);
List categoryInfoList = categoryInfoService.list(params);
model.addAttribute(“categoryInfoList”, categoryInfoList);
return “blog/bContent/add0”;
}
@GetMapping(“/edit0/{cid}”)
String edit0(@PathVariable(“cid”) Long cid, Model model) {
ContentDO bContentDO = bContentService.get(cid);
model.addAttribute(“bContent”, bContentDO);
Map<String, Object> params = new HashMap<>();
params.put(“deleted”,0);
List categoryInfoList = categoryInfoService.list(params);
model.addAttribute(“categoryInfoList”, categoryInfoList);
return “blog/bContent/edit0”;
}
@GetMapping(“/add1”)
String add1(Model model) {
Map<String, Object> params = new HashMap<>();
params.put(“deleted”,0);
List categoryInfoList = categoryInfoService.list(params);
model.addAttribute(“categoryInfoList”, categoryInfoList);
return “blog/bContent/add1”;
}
@GetMapping(“/edit1/{cid}”)
String edit1(@PathVariable(“cid”) Long cid, Model model) {
ContentDO bContentDO = bContentService.get(cid);
model.addAttribute(“bContent”, bContentDO);
Map<String, Object> params = new HashMap<>();
params.put(“deleted”,0);
List categoryInfoList = categoryInfoService.list(params);
model.addAttribute(“categoryInfoList”, categoryInfoList);
return “blog/bContent/edit1”;
}
@ResponseBody
@PostMapping(“/save”)
public R save(ContentDO bContent) {

  if (bContent.getAllowComment() == null) {
     bContent.setAllowComment(0);
  }
  if (bContent.getAllowFeed() == null) {
     bContent.setAllowFeed(0);
  }
  if(null==bContent.getType()) {
     bContent.setType("article");
  }
  bContent.setGtmCreate(new Date());
  bContent.setGtmModified(new Date());
  int count;
  if (bContent.getCid() == null || "".equals(bContent.getCid())) {
     bContent.setCreated(getUserId());
     count = bContentService.save(bContent);
  } else {
     count = bContentService.update(bContent);
  }
  if (count > 0) {
     return R.ok().put("cid", bContent.getCid());
  }
  return R.error();

}
@ResponseBody
@RequestMapping(“/update”)
public R update( ContentDO bContent) {

  bContent.setGtmCreate(new Date());
  bContentService.update(bContent);
  return R.ok();

}
@PostMapping(“/remove”)
@ResponseBody
public R remove(Long id) {

  if (bContentService.remove(id) > 0) {
     return R.ok();
  }
  return R.error();

}
@PostMapping(“/batchRemove”)
@ResponseBody
public R remove(@RequestParam(“ids[]”) Long[] cids) {

  bContentService.batchRemove(cids);
  return R.ok();

}
}