Skip to content

Commit 5352924

Browse files
committed
Header compatibility with Golang
1 parent ad88182 commit 5352924

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
RELEASE_DIR=./release
2-
VER=1.9.1
2+
VER=1.9.2
33
NODE_VER=10.17.0-jessie
44
DOCKER_IMG_NAME=appmesh-ui:${VER}
55

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
## Build Docker image
1313
```bash
14-
VER=1.9.1
14+
VER=1.9.2
1515
cd appmesh-ui/
1616
make
1717

@@ -43,7 +43,7 @@ npm run lint -- --fix
4343
## Deploy
4444
Use host mode networking for Nginx reverse proxy (need accept host 443 port)
4545
```bash
46-
appc reg -n appweb --perm 11 -e APP_DOCKER_OPTS="--net=host -v /opt/appmesh/ssl/server.pem:/etc/nginx/conf.d/server.crt:ro -v /opt/appmesh/ssl/server-key.pem:/etc/nginx/conf.d/server.key:ro" -c "nginx -g 'daemon off;'" -d laoshanxi/appmesh-ui:1.9.1 -f
46+
appc reg -n appweb --perm 11 -e APP_DOCKER_OPTS="--net=host -v /opt/appmesh/ssl/server.pem:/etc/nginx/conf.d/server.crt:ro -v /opt/appmesh/ssl/server-key.pem:/etc/nginx/conf.d/server.key:ro" -c "nginx -g 'daemon off;'" -d laoshanxi/appmesh-ui:1.9.2 -f
4747
```
4848

4949
## Demo

nginx/default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ server {
2727
add_header Access-Control-Allow-Origin *;
2828
add_header Access-Control-Allow-Credentials true;
2929
add_header Access-Control-Allow-Methods 'GET,POST,OPTIONS,PUT,DELETE';
30-
add_header Access-Control-Allow-Headers 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,X-Data-Type,X-Requested-With,X-Data-Type,X-Auth-Token,UserName,Password,NewPassword,AuthPermission,ExpireSeconds,FilePath';
30+
add_header Access-Control-Allow-Headers 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,X-Data-Type,X-Requested-With,X-Data-Type,X-Auth-Token,Username,Password,New-Password,Auth-Permission,Expire-Seconds,File-Path';
3131

3232
if ($request_method = 'OPTIONS') {
3333
return 204;

src/api/files.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function upload(filepath, data) {
55
url: '/appmesh/file/upload',
66
method: 'POST',
77
headers:{
8-
"FilePath" : filepath,
8+
"File-Path" : filepath,
99
'Content-Type': 'multipart/form-data'
1010
},
1111
data: data
@@ -17,7 +17,7 @@ export function download(filepath) {
1717
url: '/appmesh/file/download',
1818
method: 'GET',
1919
headers:{
20-
"FilePath" : filepath
20+
"File-Path" : filepath
2121
},
2222
responseType: 'blob'
2323
})

src/api/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import request from '@/utils/request'
22

33
export function login(data) {
4-
data["ExpireSeconds"] = 60 * 60 * 8;
4+
data["Expire-Seconds"] = 60 * 60 * 8;
55
return request({
66
url: '/appmesh/login',
77
method: 'post',

src/store/modules/user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ const actions = {
4040
login({ commit }, userInfo) {
4141
const { UserName, Password } = userInfo
4242
return new Promise((resolve, reject) => {
43-
login({ UserName: Base64.encode(UserName.trim()), Password: Base64.encode(Password) }).then(response => {
43+
login({ Username: Base64.encode(UserName.trim()), Password: Base64.encode(Password) }).then(response => {
4444
const { data } = response;
4545
let user = {
46-
token: data.AccessToken,
46+
token: data['Access-Token'],
4747
name: data.profile.name,
4848
account: UserName,
4949
auth: Password,

src/views/files/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default {
117117
);
118118
},
119119
submitUpload() {
120-
this.headers["FilePath"] = encodeURI(
120+
this.headers["File-Path"] = encodeURI(
121121
this.form.filepath + this.form.filename
122122
);
123123
this.headers["Authorization"] = "Bearer " + getToken();

src/views/security/changePwd.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default {
7474
this.loading = true;
7575
if (valid) {
7676
updatePwd(this.$store.getters.name, {
77-
NewPassword: Base64.encode(this.form.newPwd),
77+
"New-Password": Base64.encode(this.form.newPwd),
7878
}).then(
7979
(res) => {
8080
this.$message.success("Password update successfully.", 5000);

0 commit comments

Comments
 (0)