Skip to content

feat: re-add cookie-based login method #969

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

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: optimize tslint config
  • Loading branch information
leozhao21 committed Jul 30, 2024
commit c064040178e52eb83e64b6777cd201e990a343bb
4 changes: 2 additions & 2 deletions src/leetCodeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ class LeetCodeManager extends EventEmitter {
} else if (data.match(this.failRegex)) {
childProc.stdin?.end();
return reject(new Error("Faile to login"));
} else if (data.match(/login: /)){
} else if (data.match(/login: /)) {
childProc.stdin?.write(`${name}\n`);
} else if (data.match(/cookie: /)){
} else if (data.match(/cookie: /)) {
childProc.stdin?.write(`${cookie}\n`);
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/httpUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function LcAxios<T = any>(path: string, settings?: AxiosRequestConfig): A
}
return axios(path, {
headers: {
referer: referer,
referer,
"content-type": "application/json",
cookie,
...(settings && settings.headers),
Expand Down
2 changes: 1 addition & 1 deletion src/utils/toolUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function parseQuery(query: string): { [key: string]: string } {
return queryObject;
}

let keyValuePairs = query.split("&");
const keyValuePairs = query.split("&");
keyValuePairs.forEach((pair) => {
const firstEqualsIndex = pair.indexOf("=");
if (firstEqualsIndex !== -1) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/trackingUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class TrackData implements ITrackData {
if (!Array.isArray(reportItems)) {
reportItems = [reportItems];
}
let randomId = getRandomString(60);
const randomId = getRandomString(60);
reportItems.forEach((item) => {
this.reportCache.push({
...item,
Expand Down
44 changes: 18 additions & 26 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"extends": ["tslint:recommended"],
"jsRules": {},
"rules": {
"forin": false,
"object-literal-sort-keys": false,
"indent": [
true,
"spaces"
],
"ordered-imports": [false],
"indent": [true, "spaces"],
"no-string-literal": false,
"no-namespace": false,
"max-line-length": [
false,
120
],
"typedef": [
true,
"call-signature",
"arrow-call-signature",
"parameter",
"arrow-parameter",
"property-declaration",
"variable-declaration",
"member-variable-declaration"
],
"variable-name": [
true,
"allow-leading-underscore"
]
"max-line-length": [false, 120],
"typedef": false,
"no-implicit-dependencies": [true, ["vscode"]],
"trailing-comma": false,
"no-any": false,
"object-literal-key-quotes": [true, "consistent-as-needed"],
"prefer-object-spread": false,
"no-unnecessary-await": false,
"semicolon": [false],
"quotemark": [false],
"member-ordering": [false],
"variable-name": [false],
"curly": false,
"interface-over-type-literal": [false],
"no-unused-expression": false
},
"rulesDirectory": []
}
Loading