Skip to content

Commit

Permalink
Merge pull request #17 from Time-Machine-Lab/ximena
Browse files Browse the repository at this point in the history
跨域
  • Loading branch information
LisianthusLeaf authored Dec 17, 2024
2 parents 71b1ec2 + 215513a commit b7a62ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ server {
listen 8080;
listen 80;
# listen 443 ssl;

server_name localhost;
# server_name lisianthus.cn www.lisianthus.cn;

# ssl_certificate /etc/nginx/ssl/lisianthus.cn_bundle.pem;
Expand All @@ -19,6 +19,12 @@ server {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
index index.html index.htm;

proxy_pass http://119.3.234.15:9000;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}

error_page 500 502 503 504 /50x.html;
Expand Down
2 changes: 1 addition & 1 deletion src/util/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const retryDelay = 1000; // 设置重试的间隔时间
request.interceptors.request.use(
(config) => {
config.headers['Content-Type'] = 'application/json';
const Authorization = storage.get<string>('Authorization')
const Authorization = storage.get<string>('token')
if(Authorization) config.headers.Authorization = Authorization
return config;
},
Expand Down

0 comments on commit b7a62ae

Please sign in to comment.