get-system-info.js 769 B

123456789101112131415161718192021222324252627
  1. import { implJsapi } from './base';
  2. export var getSystemInfo = implJsapi({
  3. wechat: function (instance) {
  4. return new Promise(function (resolve, reject) {
  5. instance.getSystemInfo({
  6. success: function (res) {
  7. resolve(res);
  8. },
  9. fail: function (err) {
  10. reject(err);
  11. },
  12. });
  13. });
  14. },
  15. alipay: function (instance) {
  16. return new Promise(function (resolve, reject) {
  17. instance.getSystemInfo({
  18. success: function (res) {
  19. resolve(res);
  20. },
  21. fail: function () {
  22. reject();
  23. },
  24. });
  25. });
  26. },
  27. });