How to send Basic Auth? to axios of vue

there are places where post Basic Auth is needed in the project. It is no problem to configure authorization in postman, but it cannot be sent by using axios in the code. An error of 401 is reported, and relevant materials are consulted, but none of them take effect.

the following is a screenshot of chrome error

clipboard.png

related codes

axios({
              method: "post",
              url: "http://172.16.20.12:8003/rpc",
              auth: {
                username: "admin",
                password: "123456"
              }
            }).then(result=>{
              console.log("11111");
            });


Nov.14,2021

do not deal with options in the background


could you tell me the specific code to send basic auth


Hello, have you solved it? have I encountered the same situation? how to solve it

?
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5bb7a-4566f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5bb7a-4566f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?