获取数据:

service层

export async function key(params) {

  return request(`${URL_PREFIX}/getPublicKey`, {

    method: 'POST', data: params,

  });

}

model层

    * key({payload}, {call, put}) {

    const response = yield call(key, payload);

    return response;

  },

index 层

  const setKey = () => {

    props.dispatch({

      type: 'userManager/key'

    }).then((result) => {

      localStorage.setItem('publicKey', result.key);

      setPublicKeyVelue(result);

    });

  }

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部