@zgfe/business-lib 1.1.55-dev.0 → 1.1.55
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/es/demoWrapper/index.js +2 -2
- package/es/utils/ajax.js +2 -2
- package/package.json +2 -2
package/es/demoWrapper/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import request from '../utils/ajax';
|
|
|
11
11
|
import DemoContent from './content';
|
|
12
12
|
import DemoHeader from './head';
|
|
13
13
|
import './index.less';
|
|
14
|
+
import { ResponseStatus } from '../utils/type';
|
|
14
15
|
var DemoWrapper = function DemoWrapper(_ref) {
|
|
15
16
|
var children = _ref.children,
|
|
16
17
|
className = _ref.className,
|
|
@@ -38,8 +39,7 @@ var DemoWrapper = function DemoWrapper(_ref) {
|
|
|
38
39
|
}, []);
|
|
39
40
|
function getCurrentUser() {
|
|
40
41
|
request('/zg/web/v2/user/getUserInfo').then(function (res) {
|
|
41
|
-
|
|
42
|
-
if (res === null || (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.ret) === '-1') setNotLogin(true);
|
|
42
|
+
if (!res || new RegExp("".concat(ResponseStatus.notLogin)).test(res.code)) setNotLogin(true);
|
|
43
43
|
}).catch(function (err) {
|
|
44
44
|
console.error('获取用户信息失败', err);
|
|
45
45
|
}).finally(function () {
|
package/es/utils/ajax.js
CHANGED
|
@@ -77,11 +77,11 @@ export function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
77
77
|
if (new RegExp("".concat(ResponseStatus.success, "$")).test(apiResult.code)) {
|
|
78
78
|
flag = true;
|
|
79
79
|
} else if (new RegExp("".concat(ResponseStatus.notLogin)).test(apiResult.code)) {
|
|
80
|
-
flag = true;
|
|
81
80
|
msg = '账户未登录或登录已失效';
|
|
82
|
-
} else if (new RegExp("".concat(ResponseStatus.noPermission)).test(apiResult.code)) {
|
|
83
81
|
flag = true;
|
|
82
|
+
} else if (new RegExp("".concat(ResponseStatus.noPermission)).test(apiResult.code)) {
|
|
84
83
|
msg = '账户没有权限';
|
|
84
|
+
flag = true;
|
|
85
85
|
}
|
|
86
86
|
if (!flag) {
|
|
87
87
|
msg = apiResult.msg || msg;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.55
|
|
3
|
+
"version": "1.1.55",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.12.0 || ^17.0.0",
|
|
61
61
|
"yorkie": "^2.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "8272e11129d54d9ed429143cedc497527511e81e"
|
|
64
64
|
}
|