Skip to content

Commit 0c39f49

Browse files
committed
update api
1 parent a02c28c commit 0c39f49

File tree

9 files changed

+356
-317
lines changed

9 files changed

+356
-317
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
"parser": "babel-eslint"
6767
},
6868
"rules": {
69-
"vue/no-v-model-argument": "off"
69+
"vue/no-v-model-argument": "off",
70+
"no-mixed-spaces-and-tabs": "off"
7071
}
7172
},
7273
"browserslist": [

server/api/userApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ router.post('/leetcode/add', (req, res) => {
203203

204204
conn.query($sql.user.get.uid, [params.username], (iderr, idresult) => {
205205
if (iderr) return res.status(502).send({ message: iderr.sqlMessage, errorCode: iderr.errno })
206-
else conn.query(sql, [idresult[0].id, params.leetname, params.appkey, params.submitid, params.timestamp], (err, result) => {
206+
else conn.query(sql, [idresult[0].id, params.leetname, params.appkey, params.submitid, params.timestamp, params.status], (err, result) => {
207207
if (err) return res.status(502).send(err)
208208
else {
209209
console.log(`[${params.username} uid_${idresult[0].id} add submission √]`);

server/sqlMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var sqlMap = {
2525

2626
},
2727
leetcode: {
28-
add: 'insert into team_leetcode_submit(userid,leetName,appKey,submitId,timestamp) values (?,?,?,?,?)',
28+
add: 'insert into team_leetcode_submit(userid,leetName,appKey,submitId,status,timestamp) values (?,?,?,?,?,?)',
2929
get: 'select * from team_leetcode_submit where userid = ? ORDER BY submitId DESC limit ?,?',
3030
count: 'select count(*) from team_leetcode_submit',
3131
all: 'select * from team_leetcode_submit ORDER BY submitId DESC limit ?,?'

sql/table.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ create table team_leetcode_submit(
4444
leetName varchar(60),
4545
appKey varchar(60) not null,
4646
submitId varchar(30) not null,
47+
status varchar(30),
4748
timeStamp varchar(30) not null,
4849
FOREIGN KEY fk_userid(userid) REFERENCES team_user_info(id)
4950
);

src/components/CheckDays/Rank/index.vue

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
<span class="th"
1111
>{{ index + 1 }}<sup>{{ thString(index + 1) }}</sup></span
1212
>
13-
<el-icon class="icon avatar" v-if="!item.avatar"><User /></el-icon>
14-
<Avatar
15-
class="avatar"
16-
:image="item.avatar"
17-
:is-dot="false"
18-
v-else
19-
/>
2013
<span class="info">
2114
<span class="nickname">{{ item.nickname }}</span>
2215
</span>
@@ -25,11 +18,8 @@
2518
</template>
2619

2720
<script>
28-
import Avatar from "@/components/UserAssets/Avatar/index.vue"
29-
3021
export default {
3122
name: "Rank",
32-
components: { Avatar },
3323
data() {
3424
return {
3525
isLoading: true,
@@ -113,14 +103,16 @@ export default {
113103
}
114104
115105
.title {
116-
@apply sticky inline-block w-full h-full top-0 py-4 text-lg text-left border-b-2
106+
@apply sticky inline-block w-full h-full top-0 py-4 text-lg font-extralight text-left border-b-2
117107
border-gray-200 dark:border-gray-600;
118108
z-index: 2001;
119109
120110
font-family: "HanSerif";
121111
}
122112
.mainContainer {
123113
@apply relative inline-flex justify-center items-center py-4 w-full;
114+
115+
font-family: "HanyiWH";
124116
}
125117
126118
.avatar {
@@ -139,12 +131,18 @@ export default {
139131
}
140132
141133
.th {
142-
@apply inline-block text-xl w-6;
134+
@apply inline-block text-xl w-6 font-mono;
143135
}
144136
145137
@media (prefers-color-scheme: dark) {
138+
.title {
139+
@apply bg-gray-800;
140+
}
146141
}
147142
148143
@media (prefers-color-scheme: light) {
144+
.title {
145+
@apply bg-gray-100;
146+
}
149147
}
150148
</style>

src/components/Leetcode/Container/index.vue

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
<el-divider direction="vertical"></el-divider>
1515
<span class="title">{{
1616
isContentEng
17-
? questions.title
18-
: questions.translatedTitle
17+
? questions.title
18+
: questions.translatedTitle
1919
}}</span>
20-
<el-divider direction="vertical"></el-divider><span class="difficulty">{{
20+
<el-divider direction="vertical"></el-divider
21+
><span class="difficulty">{{
2122
questions.difficulty
2223
}}</span>
2324
</div>
@@ -27,10 +28,16 @@
2728
</div>
2829
<div class="codeContainer">
2930
<div class="appCodeEditer">
30-
<Codemirror class="codeView" :value="
31-
questions.codeSnippets[langCode == -1 ? 0 : langCode]
32-
.code
33-
" :options="cmOptions" border ref="codeEditor">
31+
<Codemirror
32+
class="codeView"
33+
:value="
34+
questions.codeSnippets[langCode == -1 ? 0 : langCode]
35+
.code
36+
"
37+
:options="cmOptions"
38+
border
39+
ref="codeEditor"
40+
>
3441
</Codemirror>
3542
</div>
3643
</div>
@@ -99,7 +106,7 @@ export default {
99106
this.getQuestionSubmit()
100107
})
101108
},
102-
mounted() { },
109+
mounted() {},
103110
activated() {
104111
this.initTheme()
105112
},
@@ -108,9 +115,9 @@ export default {
108115
return (
109116
(this.isContentEng
110117
? this.questions.content +
111-
"<br/><p><b>Sample Example InputCase:</b></p>"
118+
"<br/><p><b>Sample Example InputCase:</b></p>"
112119
: this.questions.translatedContent +
113-
"<br/><p><b>测试用例例如:</b></p>") +
120+
"<br/><p><b>测试用例例如:</b></p>") +
114121
this.questions.exampleTestcases
115122
)
116123
},
@@ -166,7 +173,7 @@ export default {
166173
this.$refs.codeEditor.content,
167174
this.questions.titleSlug
168175
)
169-
.then(async (response) => {
176+
.then((response) => {
170177
const { submission_id } = response.data
171178
this.$public.emit(
172179
"leetcode-submit-back-id",
@@ -178,7 +185,7 @@ export default {
178185
this.$public.emit("notice", {
179186
type: "error",
180187
time: 4500,
181-
msg: `${e.message} 未登录 Leetcode 账户或 LeetCodeApi 发生迁移`,
188+
msg: `${e.message} 未登录 Leetcode 账户或 LeetCodeApi 发生迁移`,
182189
})
183190
})
184191
})
@@ -234,15 +241,13 @@ export default {
234241
}
235242
236243
@media (prefers-color-scheme: dark) {
237-
238244
.question,
239245
.topSpan {
240246
@apply bg-gray-900;
241247
}
242248
}
243249
244250
@media (prefers-color-scheme: light) {
245-
246251
.question,
247252
.topSpan {
248253
@apply bg-white;

0 commit comments

Comments
 (0)