Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/components/Header/UserAvatar.vue
This commit is contained in:
付民康
2025-03-14 16:34:10 +08:00
5 changed files with 231 additions and 192 deletions

View File

@@ -52,13 +52,18 @@ const toggleDropDown = (isShow) => {
}
};
const logout = async() => {
const logout = async () => {
RemoveInfo(); // 目前先强制清除用户信息,后面接口通了再调
const res = await toLogout();
await reqCatch(devLogout, {}); // 清除社区登录
if (!res.error) {
RemoveInfo();
// 有权限刷新当前页,无权限需要登录返回首页
if (route.meta?.needLogin || (route.meta?.type === 'repo' && repoInfo.value?.visibility === 'private') || orgInfo.value?.visibility === 'private') {
if (
route.meta?.needLogin ||
(route.meta?.type === 'repo' && repoInfo.value?.visibility === 'private') ||
orgInfo.value?.visibility === 'private'
) {
router.push('/');
} else {
router.go(0);
@@ -84,11 +89,10 @@ const DEFAULT_ROUTER_PARAMS = Object.freeze({
params: {
namespace: accountInfo.value.username
},
query: {
}
query: {}
});
// 获取router跳转参数
const getRouterLink = params => {
const getRouterLink = (params) => {
if (typeof params === 'string') {
return {
...DEFAULT_ROUTER_PARAMS,
@@ -156,7 +160,7 @@ const blockList = ref([
justify-content: space-between;
font-size: 14px;
font-weight: 500;
color: #2D2D2E;
color: #2d2d2e;
line-height: 20px;
.close-icon {
cursor: pointer;
@@ -164,7 +168,7 @@ const blockList = ref([
}
&-id {
font-size: 12px;
color: #707A87;
color: #707a87;
line-height: 16px;
}
}
@@ -183,7 +187,6 @@ const blockList = ref([
}
}
}
</style>
<style>