diff --git a/deploy/nginx/nginx.conf b/deploy/nginx/nginx.conf index 4c8696eb010d93bfcb3094e6b0ac5e0b9fb9f99e..3f61a0c1b0822ef7b01c90af91f7d95efe663e0b 100644 --- a/deploy/nginx/nginx.conf +++ b/deploy/nginx/nginx.conf @@ -56,14 +56,6 @@ http { server_name easysoftware.openeuler.org; charset utf-8; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Frame-Options DENY; - add_header X-Content-Type-Options nosniff; - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; - add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://hm.baidu.com/; object-src 'none'; frame-src 'none'"; - add_header Cache-Control "no-cache,no-store,must-revalidate"; - add_header Pragma no-cache; - add_header Expires 0; limit_conn limitperip 10; ssl_session_tickets off; @@ -98,6 +90,15 @@ http { proxy_set_header X-Forwarded-For $http_x_real_ip; proxy_set_header Host $host; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; + add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://hm.baidu.com/; object-src 'none'; frame-src 'none'"; + add_header Cache-Control "no-cache,no-store,must-revalidate"; + add_header Pragma no-cache; + add_header Expires 0; + location /assets { add_header X-XSS-Protection "1; mode=block"; add_header X-Frame-Options DENY; @@ -117,70 +118,36 @@ http { location ^~ /server/ { proxy_set_header X-Forwarded-For $http_x_real_ip; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Frame-Options DENY; - add_header X-Content-Type-Options nosniff; - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; - add_header Content-Security-Policy "script-src 'self'; object-src 'none'; frame-src 'none'"; - add_header Cache-Control "no-cache,no-store,must-revalidate"; - add_header Pragma no-cache; - add_header Expires 0; proxy_pass https://easysoftware-service.easysoftware.svc.cluster.local:8080/; } location ^~ /api-dsapi/ { - proxy_set_header X-Forwarded-For $http_x_real_ip; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Frame-Options DENY; - add_header X-Content-Type-Options nosniff; - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; - add_header Content-Security-Policy "script-src 'self'; object-src 'none'; frame-src 'none'"; - add_header Cache-Control "no-cache,no-store,must-revalidate"; - add_header Pragma no-cache; - add_header Expires 0; + proxy_set_header X-Forwarded-For $http_x_real_ip; proxy_pass https://dsapi.osinfra.cn/; } location ^~ /api-search/ { - proxy_set_header X-Forwarded-For $http_x_real_ip; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Frame-Options DENY; - add_header X-Content-Type-Options nosniff; - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; - add_header Content-Security-Policy "script-src 'self'; object-src 'none'; frame-src 'none'"; - add_header Cache-Control "no-cache,no-store,must-revalidate"; - add_header Pragma no-cache; - add_header Expires 0; + proxy_set_header X-Forwarded-For $http_x_real_ip; proxy_pass https://doc-search.openeuler.org/; } location ^~ /api-id/ { proxy_set_header X-Forwarded-For $http_x_real_ip; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Frame-Options DENY; - add_header X-Content-Type-Options nosniff; - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; - add_header Content-Security-Policy "script-src 'self'; object-src 'none'; frame-src 'none'"; - add_header Cache-Control "no-cache,no-store,must-revalidate"; - add_header Pragma no-cache; - add_header Expires 0; proxy_pass https://omapi.osinfra.cn/; } + location /api-message/ { + proxy_set_header X-Forwarded-For $http_x_real_ip; + + proxy_pass https://message-center.openeuler.org/message_center/; + } + location /api-ip/ { proxy_set_header X-Forwarded-For $http_x_real_ip; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Frame-Options DENY; - add_header X-Content-Type-Options nosniff; - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; - add_header Content-Security-Policy "script-src 'self'; object-src 'none'; frame-src 'none'"; - add_header Cache-Control "no-cache,no-store,must-revalidate"; - add_header Pragma no-cache; - add_header Expires 0; proxy_pass http://ip-api.com/json/; } diff --git a/src/api/api-messageCenter.ts b/src/api/api-messageCenter.ts new file mode 100644 index 0000000000000000000000000000000000000000..8cb6ee28f0e310be6a025e722689992f036fac0e --- /dev/null +++ b/src/api/api-messageCenter.ts @@ -0,0 +1,23 @@ +import { request } from '@/shared/axios'; +import { getCsrfToken } from '@/shared/login'; + +/** + * 获取消息中心未读消息数量 + */ +export function getUnreadMsgCount(): Promise< + { + source: string; + count: number; + }[] +> { + const csrfToken = getCsrfToken(); + return request + .get<{ count: { source: string; count: number }[] }>( + '/api-message/inner/count', + { + headers: { token: csrfToken }, + } + ) + .then((res) => res.data.count) + .catch(() => []); +} diff --git a/src/assets/style/global.scss b/src/assets/style/global.scss index a30bb9d5431bf5aa51f7a9fa20cfb7e3f58aa2c8..a29b968089ea834e6ac08b9c5e008a072da5a1fc 100644 --- a/src/assets/style/global.scss +++ b/src/assets/style/global.scss @@ -74,7 +74,7 @@ html { height: 48px; --linear-gradient: var(--o-mixedgray-1); &.dark { - --linear-gradient: var(--o-mixedgray-4); + --linear-gradient: var(--o-mixedgray-3); } @include text1; &::after { diff --git a/src/components/header/AppLogin.vue b/src/components/header/AppLogin.vue index f8c3115dcf7ec924f4c9c78708c5d1f0ed1f97a7..bf2199ebdd8f175cf6caa77bb709357d5d8d7c47 100644 --- a/src/components/header/AppLogin.vue +++ b/src/components/header/AppLogin.vue @@ -1,16 +1,17 @@