Open
Conversation
liyupi
requested changes
Aug 24, 2023
| defaultSQL: "", | ||
| answer: "", | ||
| hint: "无此关卡", | ||
| type: "nolevel", |
Owner
There was a problem hiding this comment.
你的这种解决方案是 ok 的。但我感觉有些复杂了,完全可以定义一个 defaultLevel 的常量(比如我之前是第一关),而不用增加 TS 类型或 level 配置。我理解你这里的考虑,如果找不到关卡返回 404 也是合理的哈,但是用这种方式你还要考虑隐藏掉对应的提交按钮等,反而更麻烦了。
Contributor
Author
Contributor
Author
|
add 404页面 鱼皮大佬您好,我已经把这个改成404页面的那种形式了 |
Contributor
Author
|
鱼皮大佬您好,代码之前已经改好,为什么您一个多月都没有回复?是添加404页面的方式有问题吗 |
Contributor
Author
|
鱼皮大佬您好,我期中考试都考完了,您为什么还没回我?是404实现这种不行吗?怕您看不见@您一下 @liyupi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


修复levelKey不存在时显示level1的题目bug
就是添加了一个空的404关卡,不知道这样行不行
我把
src\levels\index.ts,getLevelByKey函数里如果在题目列表里找不到就返回404的level数据,原来返回的是第一题数据,不知道我这样改行不行,我测试了一圈,应该没有问题,不知道有没有我没有测试到的有问题的情况,还望大佬指点,谢谢我实在是不敢动那些level相关的代码,如果没有就把level置空,要改的地方太多了,很多地方都有调用关卡信息,我实在是不敢改啊。。。
又是我,14岁的那个,第三次使用typescript,应该规范一点了吧,希望鱼皮大佬指点,谢谢
最后还是要感谢鱼皮大佬开源此网站!