首页 > 解决方案 > Axios 使用基本身份验证禁用用户名和密码提示

问题描述

在使用 Axios 进行基本身份验证时,是否可以选择禁用提示,或者至少以某种方式隐藏它?

   var base64encodedData = Buffer.from(this.username + ':' + hash.hex()).toString('base64');

       var config = {
        headers: { Authorization : 'Basic '  + base64encodedData},
        responseType: 'json'
      };

      axios.get('/users/self',config)
        .then((response) => {
          console.log("response");
          console.log(response);
          console.log(response.data);
      });

在此处输入图像描述

标签: javascriptauthenticationaxios

解决方案


推荐阅读