EXCEL custom functions can use ajax?

What do I want to achieve:
I want to call the interface in a custom function,Use the data returned by the interface to calculate.

actual result:
Custom functions cannot compute the correct result,always get 0.

This is my function.js code:

function add(first, second) {
  ajax_web({
    api: API_ENTITY.LOGIN,
    data: {
      domain: '01',
      user: 'dev',
      pass: 'shijinimda',
    },
  }).then(function (data) {
    return first + second;
  })
}

Did I do something wrong?If you need more documents, please ask me.

thanks a lot