54sword / xiaoduyu.com

🐟小度鱼 - 年轻人的交流社区 https://www.xiaoduyu.com
598 stars 148 forks source link

Register #37

Open Butonix opened 6 years ago

Butonix commented 6 years ago

I'm sorry, tell me! Registration only by phone, not email?

54sword commented 6 years ago

we need comply with 《互联网跟帖评论服务管理规定》。 phone in china is Real-name system。

Butonix commented 6 years ago

that is, if I'm not from China, I can not register? can not I remove the phone and put an email for registration?

54sword commented 6 years ago

you can use GitHub sign in. or in register, you can select your country phone area code. phone is not support remove, but can change other phone.

Butonix commented 6 years ago

Ok How to add categories when publishing? and now you can not upload pictures to your server?

54sword commented 6 years ago

Question 1 1、Set up admin user, in mongodb set user role = 100 2、Sign in admin user, open http://localhost:3000/me url,have "管理社群"、"添加新的社区" features 3、In the future admin.xiaoduyu.com will have more management features

Question 2 yes, pictures and static file will upload to CDN(qiniu).

Butonix commented 6 years ago

Question 1 And as you then on the server pictures are stored on your server? https://img.xiaoduyu.com/a5ae5478-0f38-4b16-b1b9-6e6c2c42df79.png?imageMogr2/crop/!676x676a37a54/thumbnail/!50/quality/90 Question 2 can I add an email to the registration and add the upload image to my server I am ready to donate funds to the development of the project

54sword commented 6 years ago

Reply to the question 1 not, pictures is upload to CDN, then CDN can config self domain.

// my domain https://img.xiaoduyu.com/a5ae5478-0f38-4b16-b1b9-6e6c2c42df79.png?imageMogr2/crop/!676x676a37a54/thumbnail/!50/quality/90

// CDN domain https://oiy8zs2t8.qnssl.com/a5ae5478-0f38-4b16-b1b9-6e6c2c42df79.png?imageMogr2/crop/!676x676a37a54/thumbnail/!50/quality/90

Reply to the question 2 that need change code. you can use my code in your project, but the process is complicated. i don't know how to use english expression.

Butonix commented 6 years ago

You do not plan to update all the packages to more recent ones? change es2015 to env now already webpack 3.10.0 react v16 add i18n and so on i update

look error \node_modules\react-qiniu\index.js:16 onDrop: React.PropTypes.func.isRequired, ^func TypeError: Cannot read property 'func' of undefined

54sword commented 6 years ago

yes, i will update it. because react-router 4 are change too much. no time to refactor yet.

but i has been in admin.xiaoduyu.com use

support 1、server render (SEO) 2、ragmented by page (page load js on demand)


https://github.com/lenage/react-qiniu is old. in new react have error, need modify its source code

import PropTypes from 'prop-types' React.PropTypes change to PropTypes

Butonix commented 6 years ago

Look error react-route 4 TypeError: (0 , _reactRouter.match) is not a function at start (B:/OSPanel/domains/domain.dev/frontend/server/routes/serverRender.js:84:5)

54sword commented 6 years ago

react-router 4, current not support yet. need to rewrite the code.

Butonix commented 6 years ago

I'm sorry,why this error in the console constantly? polling-xhr.js:261 POST http://localhost:4000/socket.io/?EIO=3&transport=polling&t=M4pnHfx 404 (Not Found)

54sword commented 6 years ago

this is a web socket. contact to api.xiaoduyu.com. in www.xiaoduyu.com, i use nginx proxy www.xiaoduyu.com/socket.io/ to api.xiaoduyu.com. in localhost not have proxy, so have the error

Butonix commented 6 years ago

I'm sorry,one more question! 1)How to make the counter of views updated automatically, without reloading the page? suppose I'm on the publication page, if someone else has visited the same page, the counter should update immediately 2 浏览

2)how to make this download as in the photo 1

54sword commented 6 years ago

posts data is stored in redux. then use redux dispatch function to update posts.view_count data, it will automatically update view data.

https://redux.js.org/docs/basics/UsageWithReact.html

Butonix commented 6 years ago

Hi Look error console (Github auth) B:\OSPanel\domains\domains.dev\backend\node_modules\qiniu\qiniu\zone.js:24 var bucket = scope.toString().split(":")[0]; ^

TypeError: Cannot read property 'toString' of undefined at Object.exports.up_host (B:\OSPanel\domains\domains.dev\backend\node_modules\qiniu\qiniu\zone.js:24:24) at putReadable (B:\OSPanel\domains\domains.dev\backend\node_modules\qiniu\qiniu\io.js:55:8) at Object.putFile (B:\OSPanel\domains\domains.dev\backend\node_modules\qiniu\qiniu\io.js:120:10) at uploadFile (B:/OSPanel/domains/domains.dev/backend/app/api/v1/qiniu.js:55:16) at B:/OSPanel/domains/domains.dev/backend/app/api/v1/qiniu.js:59:5 at WriteStream. (B:/OSPanel/domains/domains.dev/backend/app/common/tools.js:174:7) at emitNone (events.js:111:20) at WriteStream.emit (events.js:208:7) at finishMaybe (_stream_writable.js:604:14) at afterWrite (_stream_writable.js:455:3) at onwrite (_stream_writable.js:445:7) at fs.js:2180:5 at FSReqWrap.wrapper [as oncomplete] (fs.js:685:5)

54sword commented 6 years ago

this issues, please submit here https://github.com/qiniu/nodejs-sdk/issues

Butonix commented 6 years ago

Hello! Look, you have all the articles shown in the code at once, and if there are thousands of them, will not it slow down and buggy? simply can make that articles are loaded when scrolling the page? view-source:https://www.xiaoduyu.com/

54sword commented 6 years ago

Current has been used this way. When the scroll bar to the bottom of the page, it will trigger the next page to load data.

Butonix commented 6 years ago

yes, but if you open the site from scratch and see its code, it displays all the pages at once

54sword commented 6 years ago

yes. maybe after that will add flip pages.