egg-cnode 默认的管理员如何配置

发布于 6 年前 作者 ionicwang 2054 次浏览 来自 问答

egg-cnode 官方源代码:

https://github.com/cnodejs/egg-cnode

现在egg-cnode源代码已经创建好了但是不知道如何管理别人发的帖子

默认的管理员是什么,如何配置有人知道吗?

12 回复

1、找到config.default.js

2、 config.admins = { // ADMIN_USER: true, 管理员1账户:true, 管理员2账户:true };

1.png

这是干吗用的?

你好,第一个问题,下面这一个设置怎么写,在winows下

config.passportLocal = { usernameField: ‘’, passwordField: ‘’, };

第二个问题:exports.mini_assets = true;

第三个问题: config.authUser = { enable: true, match: ‘/’, };

第四个问题 就是在windowns下,npm run assets,失败,你是怎么解决的。 no such file or directory, open ‘C:\nodeClub\app\C:\public\img\glyphicons-halflings.png’ at Object.fs.openSync (fs.js:646:18) at Object.fs.readFileSync (fs.js:551:33) at C:\nodeclub\node_modules\loader-builder\lib\builder.js:326:19 at String.replace (<anonymous>:null:null) at Object.exports.processUrl (C:\nodeclub\node_modules\loader-builder\lib
builder.js:302:15) at C:\nodeclub\node_modules\loader-builder\lib\builder.js:180:34 at Array.forEach (<anonymous>:null:null) at C:\nodeclub\node_modules\loader-builder\lib\builder.js:149:17 at Array.forEach (<anonymous>:null:null) at Object.exports.minify (C:\nodeclub\node_modules\loader-builder\lib\buil der.js:120:7) at Object.<anonymous> (C:\nodeclub\node_modules\loader-builder\bin\builder :39:24) at Module._compile (module.js:652:30) at Object.Module._extensions…js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:191:16) at bootstrap_node.js:612:3

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! cnode@1.0.0 assets: loader app/view app/ npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the cnode@1.0.0 assets script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.

╭───────────────────────────────────── ╮ │ │ │ Update available 5.6.0 → 6.4.1 │ │ Run npm i npm to update │ │ │ ╰───────────────────────────────────── ╯

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2018-11-04T0 1_31_19_198Z-debug.log

@sonong windows上面不要npm run assert

  config.passportLocal = {
    usernameField: 'name',
    passwordField: 'pass',
  };
  

alinode要配置 、redis也要安装 , github回调地址也配置一下(github上面配置)

plugin.prod.js里面的mini_assets去掉

// exports.mini_assets = false;

然后package.json start加上–ignore-stderr

 "start": "egg-scripts start --daemon --title=egg-server-cnode --ignore-stderr",
 

然后到windows服务器运行 npm start

@nodeper {app_root}/config/config.prod.js 还是配置config.default.js? 启动后样式不对,log,需要wait这么多正常吗? [egg-scripts] Save log file to C:\Users\Administrator\logs [egg-scripts] Wait Start: 1… [egg-scripts] Wait Start: 2… [egg-scripts] Wait Start: 3… [egg-scripts] Wait Start: 4… [egg-scripts] Wait Start: 5… [egg-scripts] Wait Start: 6… [egg-scripts] Wait Start: 7… [egg-scripts] Wait Start: 8… [egg-scripts] Wait Start: 9… [egg-scripts] Wait Start: 10… [egg-scripts] Wait Start: 11… [egg-scripts] Wait Start: 12… [egg-scripts] Wait Start: 13… [egg-scripts] Wait Start: 14… [egg-scripts] Wait Start: 15… [egg-scripts] Wait Start: 16… [egg-scripts] Wait Start: 17… [egg-scripts] Wait Start: 18… [egg-scripts] Wait Start: 19… [egg-scripts] Wait Start: 20… [egg-scripts] Wait Start: 21… [egg-scripts] Wait Start: 22… [egg-scripts] Wait Start: 23… [egg-scripts] Wait Start: 24… [egg-scripts] Wait Start: 25… [egg-scripts] Wait Start: 26… [egg-scripts] Wait Start: 27… [egg-scripts] Wait Start: 28… [egg-scripts] Wait Start: 29… [egg-scripts] Wait Start: 30… [egg-scripts] Wait Start: 31… [egg-scripts] Wait Start: 32… [egg-scripts] Wait Start: 33… [egg-scripts] Wait Start: 34… [egg-scripts] Wait Start: 35… [egg-scripts] Wait Start: 36… [egg-scripts] Wait Start: 37… [egg-scripts] Wait Start: 38… [egg-scripts] Wait Start: 39… [egg-scripts] Wait Start: 40… [egg-scripts] Wait Start: 41… [egg-scripts] Wait Start: 42… [egg-scripts] Wait Start: 43… [egg-scripts] Wait Start: 44… [egg-scripts] Wait Start: 45… [egg-scripts] Wait Start: 46… [egg-scripts] Wait Start: 47… [egg-scripts] Wait Start: 48… [egg-scripts] Wait Start: 49… [egg-scripts] Wait Start: 50… [egg-scripts] Wait Start: 51… [egg-scripts] Wait Start: 52… [egg-scripts] Wait Start: 53… [egg-scripts] Wait Start: 54… [egg-scripts] Wait Start: 55… [egg-scripts] Wait Start: 56… [egg-scripts] Wait Start: 57… [egg-scripts] Wait Start: 58… [egg-scripts] Wait Start: 59… [egg-scripts] Wait Start: 60… [egg-scripts] Wait Start: 61… [egg-scripts] Wait Start: 62… [egg-scripts] Wait Start: 63… [egg-scripts] Wait Start: 64… [egg-scripts] Wait Start: 65… [egg-scripts] Wait Start: 66… [egg-scripts] Wait Start: 67… [egg-scripts] Wait Start: 68… [egg-scripts] Wait Start: 69… [egg-scripts] Wait Start: 70… [egg-scripts] Wait Start: 71… [egg-scripts] Wait Start: 72… [egg-scripts] Wait Start: 73… [egg-scripts] Wait Start: 74… [egg-scripts] Wait Start: 75… [egg-scripts] Wait Start: 76… [egg-scripts] Wait Start: 77… [egg-scripts] Wait Start: 78… [egg-scripts] Wait Start: 79… [egg-scripts] Wait Start: 80… [egg-scripts] Wait Start: 81… [egg-scripts] Wait Start: 82… [egg-scripts] Wait Start: 83… [egg-scripts] egg started on http://127.0.0.1:7001 这样启动访问的样式是不对的。错位的,不知问题出在哪里?之前也这样。

邮箱我觉得配置正确的,端口是25 但是也收不到邮件。另外winwindow server 2012r2和2008r2,对于云服务器大家都用哪个啊?

@sonong 他们这个发送邮件的有bug 你可以自己重新写一下发送邮件的方法

plugin.prod.js里面的mini_assets注释掉 试试

// exports.mini_assets = false;

我发现plugin.prod.js里面的mini_assets注释掉 试试里面没有这一行。然后我就参照你的方法加上了然后再注释掉。

之前问了很多人。但是他们都非windows,刚好成功了。所以多问了一下。

@nodeper 没成功 今天拉个最新的配置一下再试试, 1、plugin.prod.js里面没有mini_assets,你们为什么会有这个? 2、配置是用/config.prod.js 还是配置config.default.js? 3、首页只显示今年的,去年前年的有却不显示,在哪里控制的啊?

回到顶部