laxative ~
the following is excerpted from the link to the question,
@ websanova/vue-auth is the library that the client handles authentication. It injects a $auth object to provide many useful functions: for example, register () handles user registration, login (), handles user login, user (), accesses the currently logged-in user data, logout (), handles exit operations, and so on.install the library first:
npm install @ websanova/vue-auth
Edit resources/assets/js/app.js: againimport Vue from 'vue';
.
Vue.use (require (' @ websanova/vue-auth'), {
auth: require ('@ websanova/vue-auth/drivers/auth/bearer.js'),
http: require ('@ websanova/vue-auth/drivers/http/axios.1.x.js'),
router: require ('@ websanova/vue-auth/drivers/router/vue-router.2.x.js'),
});
App.router = Vue.router
new Vue (App). $mount ('- sharpapp');
in the new code, we first introduce the newly installed library and do some configuration:
use bearer to add authentication token to the request header during the request. So that the server can read and parse this token:
auth: require ('@ websanova/vue-auth/drivers/auth/bearer.js')
configure vue-auth to use axios to send HTTP requests:
http: require ('@ websanova/vue-auth/drivers/http/axios.1.x.js')
We also configure vue-auth to use vue-router:
router: require ('@ websanova/vue-auth/drivers/router/vue-router.2.x.js')
finally, Notice the
meta: {auth: true}
configuration, which is used to specify whether the access route requires authentication. For more information on
, visit the @ websanova/vue-auth Github repository.
this is not very detailed, you can't understand what exactly it means? My advice is, first of all, you need to know what vue-auth
is for, what problems are used to solve, and do you need it in this project?
localhost:8080 -sharp register ; register(); :localhost:8080 ?-sharp register;ajax;;localhost:8080 ?-sharp register;home : vue@;formform ...
now the project is a front-end separation, front-end vue-cli, back-end PHP. Using the jwt-token authentication mechanism, how to prevent return attacks? ...
Development background: suppose there is a h5 app project, the front and rear ends are completely separated, the front end communicates data through json , and the front end uses vue for data rendering development. questions requirements at...
< H2 > implement a picture upload and form data submission, but there is a problem < H2 > require,module.exports require module.exports ...
the dist directory after the front end packages the files of vue, and then uses nginx reverse proxy. The ajax framework uses axios nginx configuration node.jsjson location style { proxy_pass http: localhost:8888; proxy_set_header Hos...
has been added to the php interface file: header("Access-Control-Allow-Origin:*"); header( Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept ); however, the front end still reports an error when calling the inter...
I have learned a novice vue, and I have also gone through the official website. I am a bit vague about the front and back end interfaces. I don t know if it is correct to understand this: the back end (assuming php) provides json data through .php files...
Development environment: MAC OS, APACHE, PHP7.2, ThinkPHP5, vue.js 3.0, axios. the back-end interface is developed by ThinkPHP5, and cross-domain headers have been added to return the data. Deployed on the local IP:192.168.0.3:80. the data returned b...
I am a novice, expecting VUER to give me the strength to move forward. I encountered a problem. I couldn t find out many solutions for two days. this is the sub-component code I wrote: Vue.component( list-ol ,{ props:[ name_en , name_cn ], ...
there are two related token, one is access_token , the other is refresh_token , there are two questions, please explain: The function of 1, refresh_token is to see that access_token is about to expire, then access_token will be regenerated, so...
Vueaxioshttp: locahost ...net::ERR_CONNECTION_REFUSED? header("Access-Control-Allow-Origin:*")...
requirement: when the data is saved, the time type used is timestamp, so the current insertion time is automatically saved. Then I need to count the data I inserted, and count it by time period. First, show all the months in which the data exists, click ...
in the actual development, it is found that the front and back end work together to determine the input and output format, which is very time-consuming. When the fake data is simulated, sometimes the background api can be developed. for example, some si...
The offer values of 1 and vue are set as follows: offer: { isshow:false, sum_total_price:0, sum_discount:0, sum_price:0, children:[] } The axios submission code under 2 and vue...
the native PHP,vue-cli build used before can be run by putting it directly into the running directory. the thinkPHP that just changed today, put the file after build under view, open the website and report an error. Does need additional configuration? ...
is there any websocket plug-in that can be used in vue to support disconnection and reconnection! Vue-socket doesn t work because I m using swoole, not socket.io ....