想靠记忆力是没用的,所以记录一个promise的使用

105 阅读1分钟

this.$store.dispatch('postNewProject', this.form).then(
    result => {
       res = result;
        return this.$store.dispath('xxx'); // 某接口
    },
    msg => Promise.reject(msg);
).then(
    () => {
        this.$message.success('成功');
    },
    msg => {
        this.$message.warning(msg);
    }
)