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 ที่พบในไฟล์ใบอนุญาต
ทำด้วย♥โดย Craig Pretorius