queue不需要提前configure什么东西吗?在send mail里直接可以用queue吗?
另外还有一个问题是,如何设置时效呢?给用户发的链接怎么样设置24hr有效之类的?
要在拿设置24小时以后重新生成一个random number
所以这个报错提醒要怎么避免掉?
app.js:8875 GET http://hub.gcc.dev/api/user 401 (Unauthorized)
不错哦,但是如何自动hide呢?
很好奇codecasts这个网页顶部这个彩色的横条如何制作?
如何可以制作成loading bar?
比如加载页面的时候这个横条就从左至右加载出现?
制作这样的一个东西 流程大概是什么,求指导?
我白痴了。。。
修改成 next()就好了...
可能写了一天代码脑子晕了
现在的情况是form.vue的页面点了提交以后不跳转,进入循环
hasEmail 默认的是false,我本来预想的是修改成true,只会一次,然后进入新的页面
那我怎么样在form.vue提交了以后跳转到form.checkout呢?
因为dispatch里修改hasEmail的提交的是在form.vue里
因为我需要检测有email然后才能允许进入form.checkout
问题简介:
我想在提交一个表单的时候更新vuex里的一个hasEmail为true (这样可以设置在访问某些页面的时候查看hasEmail是否为true,否则redirect),但是结果却成了无限循环。
导致$router.push()
无法正常工作吗?
求解这个无限循环怎么破?
Form.vue
register() {
this.$store.dispatch('submitFormRequest', formData).then(response => {
this.$router.push({
name:'form.checkout',
params:{
'name': this.first_name + ', ' + this.last_name,
'address': this.address,
'email': this.email
}
})
})
}
SubmitForm.js
import * as types from './../mutation-type'
export default{
state : {
hasEmail: false
},
mutations:{
[types.SET_EMAIL](state) {
state.hasEmail = true
}
},
actions:{
submitFormRequest ({dispatch}, formData){
return axios.post('/api/form/register',formData).then(response => {
dispatch('setEmailRequest')
}).catch(error => {
console.log("submit error: ", error);
})
},
setEmailRequest({dispatch,commit}){
commit({
type: types.SET_EMAIL
})
},
}
}
Routes.js
{
path: '/checkout',
name: 'form.checkout',
props: true,
component: require('./components/form/StripeTemplate'),
meta:{ requiresProps: true }
}
.
.
.
if (to.meta.requiresProps) {
console.log("here: ", Store.state.SubmitForm.hasEmail)
if (Store.state.SubmitForm.hasEmail){
return next({name: 'form.checkout'});
}
return next({name: 'form'});
}
在routes.js里执行log,得到下面结果,最后导致app.js:21533 RangeError: Maximum call stack size exceeded
error:
@JellyBool 求助啊!
don't worry, I fixed it
不应该用 props
, instead, params
will do
axios.post('/api/form/register', formData).then(response => {
this.$router.push({
name:'form.checkout',
props:{
name: this.first_name + ', ' + this.last_name,
address: this.address,
email: this.email
}
})
})
这样传输 props 到另一个component里是不是不可以?有什么办法可以在push的时候也传输data
我觉得可以讲讲如何把access_token过期时候400报错那个如何消失掉?每次都要刷新,强迫症表示很难受啊
url 里加入 /#id
id是DOM元素里的对应的位置