-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 修复levelKey不存在时显示level1的题目bug #34
base: master
Are you sure you want to change the base?
Conversation
src/levels/noLevel.ts
Outdated
defaultSQL: "", | ||
answer: "", | ||
hint: "无此关卡", | ||
type: "nolevel", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你的这种解决方案是 ok 的。但我感觉有些复杂了,完全可以定义一个 defaultLevel 的常量(比如我之前是第一关),而不用增加 TS 类型或 level 配置。我理解你这里的考虑,如果找不到关卡返回 404 也是合理的哈,但是用这种方式你还要考虑隐藏掉对应的提交按钮等,反而更麻烦了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add 404页面 鱼皮大佬您好,我已经把这个改成404页面的那种形式了 |
鱼皮大佬您好,代码之前已经改好,为什么您一个多月都没有回复?是添加404页面的方式有问题吗 |
鱼皮大佬您好,我期中考试都考完了,您为什么还没回我?是404实现这种不行吗?怕您看不见@您一下 @liyupi |
修复levelKey不存在时显示level1的题目bug
就是添加了一个空的404关卡,不知道这样行不行
我把
src\levels\index.ts
,getLevelByKey
函数里如果在题目列表里找不到就返回404的level数据,原来返回的是第一题数据,不知道我这样改行不行,我测试了一圈,应该没有问题,不知道有没有我没有测试到的有问题的情况,还望大佬指点,谢谢我实在是不敢动那些level相关的代码,如果没有就把level置空,要改的地方太多了,很多地方都有调用关卡信息,我实在是不敢改啊。。。
又是我,14岁的那个,第三次使用typescript,应该规范一点了吧,希望鱼皮大佬指点,谢谢
最后还是要感谢鱼皮大佬开源此网站!