当我实例化Vuejs (2.2.6)和Vue-resource (1.2.1)时,我使用以下代码设置标头授权,这样我就可以授权对我的API的所有请求:
Vue.http.headers.common.AUTHORIZATION = 'BEARER ...';
Run Code Online (Sandbox Code Playgroud)
但是,我想要请求第三方API,我不希望Authorization发送该字段.此外,此API不允许您使用此授权标头.
let CEP = '';
this.$http.get('https://viacep.com.br/ws/' + CEP + '/json')
.then(response => {
console.log(response.headers);
});
Run Code Online (Sandbox Code Playgroud)
这样,在Access-Control-Request-Headers上使用标头发送授权字段:
我尝试使用以下代码删除一些标题字段,但没有成功.
this.$http.headers.common.AUTHORIZATION = null;
this.$http.headers.common['Access-Control-Allow-Headers'] = null;
this.$http.get('https://viacep.com.br/ws/' + CEP + '/json')
.then(response => {
console.log(response.headers);
});
Run Code Online (Sandbox Code Playgroud)
在vue-resource文档中,可以插入对象以强制请求配置,但文档不完整.
this.$http.get('https://viacep.com.br/ws/' + CEP + '/json', {
...here...
}).then(response => {
console.log(response.headers);
});
Run Code Online (Sandbox Code Playgroud)
有没有办法删除授权字段或给定请求中的任何其他字段?
谢谢.
*更新*
通过使用拦截器(如下面的示例),我可以编辑请求,但我无法删除特定字段.
Vue.http.interceptors.push((request, next) => {
const viacep = …Run Code Online (Sandbox Code Playgroud) 我目前正在 macOS 上准备一个开发堆栈,docker-compose以便能够在PHP7-FPM(端口:9000)和nginx(端口:80)服务器上使用Xdebug(端口:9009)。
显然配置没问题,但我无法通过 IDE 进行调试。
这是我的设置:
我的.env文件:
APP_NAME=testeXdebug
HOST_SERVER_NAME=myapp
HOST_IP=docker.for.mac.localhost
# Use docker.for.mac.localhost - for OS X
# Use docker.for.win.localhost - for Windows
Run Code Online (Sandbox Code Playgroud)
该DockerfilePHP7-FPM + Xdebug的:
FROM php:7.2-fpm
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
Run Code Online (Sandbox Code Playgroud)
该docker-compose.yml文件:
version: '3.5'
services:
web:
image: nginx:1.15.2
ports:
- '80:80'
volumes:
- '.:/usr/share/nginx/html'
- './config/default.conf:/etc/nginx/conf.d/default.conf'
- '/tmp/${APP_NAME}/web:/var/log/nginx'
env_file:
- '.env'
depends_on:
- 'php-fpm'
links:
- 'php-fpm'
php-fpm:
build: './docker' …Run Code Online (Sandbox Code Playgroud) 伙计们,我正在尝试使用 proguard-maven-plugin 来混淆 .jar 应用程序。
当我尝试执行混淆过程时,我收到错误消息,指出存在意外的类。
我正在使用 Spring Boot 1.4.1.RELEASE 和 Proguard Maven 插件 2.0.13。
这是我的proguard.conf
-injars /workspace/base/target/test-1.0.0.jar
-libraryjars /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/rt.jar
-dontshrink
-dontoptimize
-dontobfuscate
-dontusemixedcaseclassnames
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod
-adaptresourcefilenames **.properties
-adaptresourcefilecontents **.properties,META-INF/MANIFEST.MF
-dontpreverify
-verbose
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * extends java.beans.BeanInfo
-keep class * {
void set*(***);
void set*(int,***);
boolean is*();
boolean is*(int);
*** get*();
*** get*(int);
}
-assumenosideeffects public …Run Code Online (Sandbox Code Playgroud) fpm ×1
javascript ×1
maven ×1
nginx ×1
php-7.2 ×1
proguard ×1
spring-boot ×1
vue-resource ×1
vue.js ×1
vuejs2 ×1
xdebug ×1