Skip to content

Commit

Permalink
feat: 登录实现改版
Browse files Browse the repository at this point in the history
  • Loading branch information
moshangqi committed Nov 1, 2023
1 parent da2276d commit e983030
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
"description": "语雀浏览器插件",
"private": true,
"releaseNotes": [
"[特性] 剪藏到支持记住上次保存位置",
"[特性] 划词支持拖拽排序",
"[优化] 支持语雀内容的剪藏",
"[优化] 支持实时更新知识库列表"
"[特性] 剪藏侧边栏改版",
"[特性] 支持剪藏快捷键操作",
"[特性] 划词新增修饰快捷键"
],
"repository": {
"type": "git",
Expand Down
7 changes: 5 additions & 2 deletions src/background/actionListener/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { STORAGE_KEYS, YUQUE_DOMAIN } from '@/config';
import { RequestMessage } from './index';

export const SERVER_URLS = {
LOGOUT: `${YUQUE_DOMAIN}/logout`,
LOGIN_PAGE: `${YUQUE_DOMAIN}/login`,
LOGIN: `${YUQUE_DOMAIN}/api/accounts/login`,
DASHBOARD: `${YUQUE_DOMAIN}/dashboard`,
};
Expand All @@ -26,7 +26,7 @@ const createLoginWindow = (): Promise<number> => {
left: 400,
top: 100,
type: 'panel',
url: SERVER_URLS.LOGOUT,
url: SERVER_URLS.LOGIN_PAGE,
},
res => resolve(res?.id as number),
);
Expand Down Expand Up @@ -65,6 +65,9 @@ export async function createUserActionListener(
switch (type) {
case OperateUserEnum.login: {
try {
await requestFn('/api/accounts/logout', {
method: 'DELETE',
});
const windowId = await createLoginWindow();
await waitForWindowLogined(windowId);
await removeWindow(windowId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
transform: translateY(14px);
.yuque-chrome-extension-tooltip-inner {
background-color: @blue-5;
display: flex;
align-items: center;
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/components/UserAvatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ const UserAvatar = () => {
onLogout?.();
break;
case 'feedback':
window.open(LinkHelper.feedback, '_blank');
break;
case 'useHelp': {
window.open(LinkHelper.helpDoc, '_blank');
break;
}
case 'upgrade-version':
Modal.confirm({
content: (
Expand Down Expand Up @@ -74,6 +78,10 @@ const UserAvatar = () => {
</div>
),
},
{
key: 'useHelp',
label: __i18n('使用帮助'),
},
{
key: 'feedback',
label: __i18n('问题反馈'),
Expand Down

0 comments on commit e983030

Please sign in to comment.