Closed JasonQSY closed 7 years ago
A very big problem is you store everything in session. I have provided detail reasons for why you should not do that in the commit https://github.com/JasonQSY/TodoList/commit/1d0a6c704ea427b345e84c365ee0fc9cdfc2ccd2
Since you have wrapped todo list as a class, you can change the logic for storage with affecting other code. Plain file is a good choice, you can use json
or csv
. ie:
{
"user":"at15",
"list": [{"name":"eat","status":1},{"name":"drink","status":2}]
}
at15,eat,1,drink,2
arrowrowe,东方,1,凉宫,2
Also you can refer to other guys' solution. Sometimes take a look at other peoples work is more important than try to handle everything by yourself.
Ref:
Have a look at the slide for solution:
Hello, I've completed the todolist assignment (assignment 1). Since I tried to make it look a bit nicer, I added
default.css
.Previously, I wanted to hand in the assignment after I completed the demo. However, @at15 told me that it is unnecessary to submit it after I complete everything. It is still a shame that the server is broken and I decide to add a snapshot instead.
Repo at https://github.com/JasonQSY/TodoList