Loopback远程方法调用两次

时间:2018-06-19 09:19:53

标签: node.js loopbackjs vuex

这是我的模型,我有一个远程方法。

CustomUser.remoteMethod('uLogin', {
    accepts: [
        { arg: 'data', type: 'object', http: { source: 'body' } },
        { arg: 'req', type: 'object', http: { source: 'req' } },
    ],
    returns: { arg: 'result', type: 'object' },
    http: { verb: 'post' }
});

当我调用POST uLogin时,它会被调用两次。我想这与指定每个参数的来源有关。

CustomUser.uLogin = function(data, req, callback) {
    console.log('loggin in');
}

Console说:

logging in
logging in

请帮助我!

0 个答案:

没有答案
相关问题