verifyKeys.js 695 B

12345678910111213141516171819202122232425262728
  1. const app = getApp()
  2. const appConfig = require("../config");
  3. const utils = require("../utils/util");
  4. var verifyKeys = function (publicKey, privateKey) {
  5. var header = {
  6. 'content-type': 'application/x-www-form-urlencoded',
  7. 'cookie': wx.getStorageSync(appConfig.storeKeys.sessionId)
  8. };
  9. wx.request({
  10. url: utils.getUrl('verifyKeys'),
  11. header: header,
  12. data : {
  13. public_key : publicKey,
  14. private_key : privateKey
  15. },
  16. method: "POST",
  17. dataType: "json",
  18. success: function (req) {
  19. app.verifyKeysSuccessSync(req.data)
  20. },
  21. fail: function (req) {
  22. app.verifyKeysSuccessSync(appConfig.networkError);
  23. }
  24. })
  25. }
  26. module.exports = verifyKeys