vue aspnet auth
v1.5.4
غلاف إضافي VUE لـ ASPNET-Auth.
من 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` ;
} ,
} ;حقوق الطبع والنشر © 2018 Code HQ (Pty) Ltd. تم ترخيص رمز المصدر هذا بموجب ترخيص MIT الموجود في ملف الترخيص.
صنعت مع ♥ من قبل كريج بريتوريوس