educoreapp2 1.0.35 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Tools.js CHANGED
@@ -91,7 +91,7 @@ class Tools {
91
91
  static LSDel(key) {
92
92
  localStorage.removeItem(key);
93
93
  }
94
- static alert(mess) {
94
+ static alert(mess, type) {
95
95
  alert(mess);
96
96
  }
97
97
  static LSSet(key, val) {
@@ -48,7 +48,7 @@ class APIFaker extends _react.Component {
48
48
  let path = this.api + "/" + module + "/" + name;
49
49
  let aa = new _ApiFakerMethods.default();
50
50
  console.log("FAKER", path);
51
- return aa.run(module, name, params, success, error);
51
+ return await aa.run(module, name, params, success, error);
52
52
  }
53
53
  render() {
54
54
  return /*#__PURE__*/_react.default.createElement("div", null);
@@ -62,6 +62,21 @@ class BaseForm extends _react.Component {
62
62
  }
63
63
  return res;
64
64
  }
65
+ async setErrorBadLoginOrPasswd() {
66
+ for (let k in this.objs) {
67
+ let el = this.objs[k];
68
+ el.setError('BAD_LOGIN_OR_PASSWORD');
69
+ }
70
+ }
71
+ async setError(ee) {
72
+ if (ee.code != 500) {
73
+ return;
74
+ }
75
+ if (ee.error.type == 'BAD_LOGIN_OR_PASSWORD') {
76
+ await this.setErrorBadLoginOrPasswd();
77
+ return;
78
+ }
79
+ }
65
80
  async handle2() {
66
81
  let x = await this.valid();
67
82
  if (!x) {
@@ -75,6 +90,7 @@ class BaseForm extends _react.Component {
75
90
  this2.props.onSucc(ss.data);
76
91
  }, ee => {
77
92
  //if ()
93
+ this2.setError(ee);
78
94
  console.log("XxxiiiixXX3eeee", ee);
79
95
  });
80
96
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "educoreapp2",
3
3
  "private": false,
4
- "version": "1.0.35",
4
+ "version": "1.0.37",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "files": [