Skip to content

Commit b7a62ae

Browse files
Merge pull request #17 from Time-Machine-Lab/ximena
跨域
2 parents 71b1ec2 + 215513a commit b7a62ae

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

nginx.conf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ server {
22
listen 8080;
33
listen 80;
44
# listen 443 ssl;
5-
5+
server_name localhost;
66
# server_name lisianthus.cn www.lisianthus.cn;
77

88
# ssl_certificate /etc/nginx/ssl/lisianthus.cn_bundle.pem;
@@ -19,6 +19,12 @@ server {
1919
root /usr/share/nginx/html;
2020
try_files $uri $uri/ /index.html;
2121
index index.html index.htm;
22+
23+
proxy_pass http://119.3.234.15:9000;
24+
add_header 'Access-Control-Allow-Origin' '*';
25+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
26+
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
27+
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
2228
}
2329

2430
error_page 500 502 503 504 /50x.html;

src/util/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const retryDelay = 1000; // 设置重试的间隔时间
1414
request.interceptors.request.use(
1515
(config) => {
1616
config.headers['Content-Type'] = 'application/json';
17-
const Authorization = storage.get<string>('Authorization')
17+
const Authorization = storage.get<string>('token')
1818
if(Authorization) config.headers.Authorization = Authorization
1919
return config;
2020
},

0 commit comments

Comments
 (0)