我正在使用Postman来测试我的 API。我正在使用自签名证书在我的应用程序中使用 HTTPS。
打开 HTTPS 设置后,邮递员应用程序显示此错误
表明
错误:自签名证书
当我在邮递员设置中关闭 SSL 证书验证时,API 调用可以正常工作。我尝试在邮递员应用程序中安装证书/密钥,但它不起作用。
我想在邮递员中使用证书/密钥,以便我可以使用 SSL 访问 API。有什么办法可以做到这一点吗?
public class LoginRegister extends AppCompatActivity implements SignUpFragment.OnFragmentInteractionListener ,SignInFragment.OnFragmentInteractionListener{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_register);
final TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout_signup);
tabLayout.addTab(tabLayout.newTab().setText("Sign Up"));
tabLayout.addTab(tabLayout.newTab().setText("Sign in"));
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
final ViewPager pager =(ViewPager) findViewById(R.id.loginpager);
final SigninPagerAdapter adapter = new SigninPagerAdapter(getSupportFragmentManager(),tabLayout.getTabCount());
pager.setAdapter(adapter);
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
pager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
Run Code Online (Sandbox Code Playgroud)
当我滑过片段时,标签的高光不会改变,但是当我触摸标签时它会正常工作.当我触摸它们时,标签指示器从左向右滑动很好,标签的字体颜色也会突出显示.我认为问题在于这段代码
pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
} …Run Code Online (Sandbox Code Playgroud) 我在我的节点项目中使用 Typescript,这是我的 tsconfig -
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist/application",
"baseUrl": "./src",
"paths": {
"*": [
"node_modules/*",
"src/shared/types/*"
]
}
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules"
],
"typedocOptions": {
"mode": "modules",
"out": "docs"
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的应用程序文件夹结构 -
.
??? dist
? ??? application
? ??? app.js
? ??? app.js.map
? ??? modules
? ??? shared
??? environments
? ??? .env.development
??? node_modules
??? nodemon.json
??? package-lock.json
??? …Run Code Online (Sandbox Code Playgroud) android ×1
build ×1
certificate ×1
https ×1
node.js ×1
package.json ×1
postman ×1
ssl ×1
tabs ×1
typescript ×1
webpack ×1