Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Register #37

Open
Butonix opened this issue Jan 22, 2018 · 21 comments
Open

Register #37

Butonix opened this issue Jan 22, 2018 · 21 comments

Comments

@Butonix
Copy link

Butonix commented Jan 22, 2018

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

@54sword
Copy link
Owner

54sword commented Jan 22, 2018

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

@Butonix
Copy link
Author

Butonix commented Jan 22, 2018

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
Copy link
Owner

54sword commented Jan 22, 2018

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
Copy link
Author

Butonix commented Jan 22, 2018

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

@54sword
Copy link
Owner

54sword commented Jan 23, 2018

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
Copy link
Author

Butonix commented Jan 23, 2018

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
Copy link
Owner

54sword commented Jan 23, 2018

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
Copy link
Author

Butonix commented Jan 25, 2018

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
Copy link
Owner

54sword commented Jan 26, 2018

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

  • webpack 3
  • react 16
  • react-router 4
  • react-redux
  • css modules
  • babel-polyfill
  • service worker
  • i18n (uncertain)

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
Copy link
Author

Butonix commented Jan 26, 2018

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
Copy link
Owner

54sword commented Jan 26, 2018

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

@Butonix
Copy link
Author

Butonix commented Jan 26, 2018

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
Copy link
Owner

54sword commented Jan 27, 2018

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
Copy link
Author

Butonix commented Jan 27, 2018

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
Copy link
Owner

54sword commented Jan 27, 2018

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
Copy link
Author

Butonix commented Jan 31, 2018

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
Copy link
Owner

54sword commented Jan 31, 2018

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

@Butonix
Copy link
Author

Butonix commented Feb 8, 2018

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
Copy link
Owner

54sword commented Feb 8, 2018

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
Copy link
Author

Butonix commented Feb 8, 2018

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

@54sword
Copy link
Owner

54sword commented Feb 8, 2018

yes.
maybe after that will add flip pages.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants