doterlin / vue-example-login Goto Github PK
View Code? Open in Web Editor NEW🔥A login demo for Vue.js.
License: MIT License
🔥A login demo for Vue.js.
License: MIT License
根据readme的描述判断是否登录,但是如果后台session过期,前台怎么知道?
如果有多余两个页面的话要怎么操作跳转...?
当/user_info 有自路由的时候 checkLogin 方法是不是 欠妥当,都要重定向到 user_info 页?
ts.$http.get()这里需要改为this.
new Vue({
data:{},
el: '#app',
router,
components: { App },
template: '',
methods:{
checkLogin:function() {
if(!this.getCookie('session')){
this.$router.push('/login')
}else{
this.$router.push('/userinfo')
}
},
},
created:function () {
this.checkLogin();
},
})
为什么会报这个错误?
,"$route" : 'checkLogin' 的话,其它子路由无法跳转.去掉了else{
this.$router.push('/user_info');
},才可以 否则永远在user_info这个页面
border-radius: 5px; -webkit-box-shadow: 0px 3px 16px -5px #070707; box-shadow: 0px 3px 16px -5px #070707}
why is there a "}"?
i think some typo here
想问问有没有没有压缩的版本呢
效果还是不错,有移动端的版本就好了,谢谢
http://localhost:8080/#/login 跳到登陆页, 把url的login随便改成什么都会跳到login,为什么
我已经把app.js的checkLogin方法注释了,还是会跳到登陆页。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.