vue aspnet auth
v1.5.4
Aspnet-Auth 용 Vue 플러그인 래퍼.
NPM에서
npm install vue-aspnet-auth --save플러그인을 가져오고 초기화합니다.
import { AspnetAuth } from 'vue-aspnet-auth' ;
Vue . use ( AspnetAuth , {
url : 'http://localhost:46993' ,
} ) ;기본 로그인 예 :
export default {
name : 'login' ,
data ( ) {
return {
username : '' ,
password : '' ,
} ;
} ,
methods : {
login ( ) {
this . $auth . login ( this . username , this . password , ( data ) => {
if ( data . result ) {
this . $store . commit ( 'auth' , this . $auth . authentication ) ;
this . $root . $emit ( 'app.loggedin' ) ;
} else {
this . error = data . message ;
}
} ) ;
} ,
} ,
created ( ) {
// initialize url
this . $auth . url = `http://localhost:1234` ;
} ,
} ;Copyright © 2018 Code HQ (Pty) Ltd.이 소스 코드는 라이센스 파일에있는 MIT 라이센스에 따라 라이센스가 부여됩니다.
Craig Pretorius의 ♥으로 만들어졌습니다