Skip to content

Commit

Permalink
Header compatibility with Golang
Browse files Browse the repository at this point in the history
  • Loading branch information
laoshanxi committed Apr 24, 2021
1 parent ad88182 commit 5352924
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RELEASE_DIR=./release
VER=1.9.1
VER=1.9.2
NODE_VER=10.17.0-jessie
DOCKER_IMG_NAME=appmesh-ui:${VER}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## Build Docker image
```bash
VER=1.9.1
VER=1.9.2
cd appmesh-ui/
make

Expand Down Expand Up @@ -43,7 +43,7 @@ npm run lint -- --fix
## Deploy
Use host mode networking for Nginx reverse proxy (need accept host 443 port)
```bash
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
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
```

## Demo
Expand Down
2 changes: 1 addition & 1 deletion nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ server {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Methods 'GET,POST,OPTIONS,PUT,DELETE';
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';
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';

if ($request_method = 'OPTIONS') {
return 204;
Expand Down
4 changes: 2 additions & 2 deletions src/api/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function upload(filepath, data) {
url: '/appmesh/file/upload',
method: 'POST',
headers:{
"FilePath" : filepath,
"File-Path" : filepath,
'Content-Type': 'multipart/form-data'
},
data: data
Expand All @@ -17,7 +17,7 @@ export function download(filepath) {
url: '/appmesh/file/download',
method: 'GET',
headers:{
"FilePath" : filepath
"File-Path" : filepath
},
responseType: 'blob'
})
Expand Down
2 changes: 1 addition & 1 deletion src/api/user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import request from '@/utils/request'

export function login(data) {
data["ExpireSeconds"] = 60 * 60 * 8;
data["Expire-Seconds"] = 60 * 60 * 8;
return request({
url: '/appmesh/login',
method: 'post',
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ const actions = {
login({ commit }, userInfo) {
const { UserName, Password } = userInfo
return new Promise((resolve, reject) => {
login({ UserName: Base64.encode(UserName.trim()), Password: Base64.encode(Password) }).then(response => {
login({ Username: Base64.encode(UserName.trim()), Password: Base64.encode(Password) }).then(response => {
const { data } = response;
let user = {
token: data.AccessToken,
token: data['Access-Token'],
name: data.profile.name,
account: UserName,
auth: Password,
Expand Down
2 changes: 1 addition & 1 deletion src/views/files/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default {
);
},
submitUpload() {
this.headers["FilePath"] = encodeURI(
this.headers["File-Path"] = encodeURI(
this.form.filepath + this.form.filename
);
this.headers["Authorization"] = "Bearer " + getToken();
Expand Down
2 changes: 1 addition & 1 deletion src/views/security/changePwd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default {
this.loading = true;
if (valid) {
updatePwd(this.$store.getters.name, {
NewPassword: Base64.encode(this.form.newPwd),
"New-Password": Base64.encode(this.form.newPwd),
}).then(
(res) => {
this.$message.success("Password update successfully.", 5000);
Expand Down

0 comments on commit 5352924

Please sign in to comment.