Skip to content

Commit daeb35e

Browse files
authored
Merge pull request #242 from sealye09/cookie-login-bug
Cookie login bug
2 parents 5dbf1cf + b6e75fa commit daeb35e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rpc/factory/api/userApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class UserApi extends ApiBase {
141141
// show current user
142142
user = sessionUtils.getUser();
143143
if (user) {
144-
reply.info(JSON.stringify({ code: 100, user_name: user.name }));
144+
reply.info(JSON.stringify({ code: 100, user_name: user.login }));
145145
} else return reply.info(JSON.stringify({ code: -7, msg: "You are not login yet?" }));
146146
}
147147
}

src/service/StatusBarService.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ class StatusBarService implements Disposable {
4545

4646
public async getLoginStatus(): Promise<void> {
4747
try {
48-
const result: string = await executeService.getUserInfo();
49-
this.currentUser = this.tryParseUserName(result);
48+
const result: any = await executeService.getUserInfo();
49+
// BUG: this.tryParseUserName(result)拿到的是对象,而不是字符串
50+
// this.currentUser = this.tryParseUserName(result);
51+
this.currentUser = { ...result, user_name: result.login };
5052
this.userStatus = UserStatus.SignedIn;
5153
if (this.currentUser == undefined) {
5254
this.userStatus = UserStatus.SignedOut;

0 commit comments

Comments
 (0)