dlt-for-react 1.0.19 → 1.0.21

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/README.md CHANGED
@@ -8,7 +8,7 @@ npm publish
8
8
 
9
9
  ## 前端 dlt-for-react 依赖包版本更新记录
10
10
 
11
- ##### 当前最新版本:1.0.19
11
+ ##### 当前最新版本:1.0.20
12
12
 
13
13
  ##### 安装依赖
14
14
 
@@ -16,6 +16,14 @@ npm publish
16
16
 
17
17
  ##### 版本修改记录
18
18
 
19
+ #### V1.0.21—2023 年 11 月 3 日
20
+
21
+ 1. 统一登录页接口
22
+
23
+ #### V1.0.20—2023 年 11 月 2 日
24
+
25
+ 1. 修改登录接口传参bug
26
+
19
27
  #### V1.0.19—2023 年 11 月 1 日
20
28
 
21
29
  1. 补充 KyTextArea 组件
@@ -491,7 +491,7 @@ var _initialiseProps = function _initialiseProps() {
491
491
  }
492
492
 
493
493
  _context.next = 5;
494
- return NHFetch('/openapi/getCsszByCsbz', 'GET', { csbz: 'XTGL_TSZF' });
494
+ return NHFetch('/outer/getCsszByCsbz', 'GET', { csbz: 'XTGL_TSZF' });
495
495
 
496
496
  case 5:
497
497
  res = _context.sent;
@@ -1,94 +1,94 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _tooltip = require('antd/lib/tooltip');
7
+ var _tooltip = require("antd/lib/tooltip");
8
8
 
9
9
  var _tooltip2 = _interopRequireDefault(_tooltip);
10
10
 
11
- var _checkbox = require('antd/lib/checkbox');
11
+ var _checkbox = require("antd/lib/checkbox");
12
12
 
13
13
  var _checkbox2 = _interopRequireDefault(_checkbox);
14
14
 
15
- var _button = require('antd/lib/button');
15
+ var _button = require("antd/lib/button");
16
16
 
17
17
  var _button2 = _interopRequireDefault(_button);
18
18
 
19
- var _input = require('antd/lib/input');
19
+ var _input = require("antd/lib/input");
20
20
 
21
21
  var _input2 = _interopRequireDefault(_input);
22
22
 
23
- var _icon = require('antd/lib/icon');
23
+ var _icon = require("antd/lib/icon");
24
24
 
25
25
  var _icon2 = _interopRequireDefault(_icon);
26
26
 
27
- var _modal = require('antd/lib/modal');
27
+ var _modal = require("antd/lib/modal");
28
28
 
29
29
  var _modal2 = _interopRequireDefault(_modal);
30
30
 
31
- var _NHFetch2 = require('xgui-for-react/lib/utils/NHFetch');
31
+ var _NHFetch2 = require("xgui-for-react/lib/utils/NHFetch");
32
32
 
33
33
  var _NHFetch3 = _interopRequireDefault(_NHFetch2);
34
34
 
35
- var _extends2 = require('babel-runtime/helpers/extends');
35
+ var _extends2 = require("babel-runtime/helpers/extends");
36
36
 
37
37
  var _extends3 = _interopRequireDefault(_extends2);
38
38
 
39
- var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
39
+ var _getPrototypeOf = require("babel-runtime/core-js/object/get-prototype-of");
40
40
 
41
41
  var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
42
42
 
43
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
43
+ var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
44
44
 
45
45
  var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
46
46
 
47
- var _createClass2 = require('babel-runtime/helpers/createClass');
47
+ var _createClass2 = require("babel-runtime/helpers/createClass");
48
48
 
49
49
  var _createClass3 = _interopRequireDefault(_createClass2);
50
50
 
51
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
51
+ var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
52
52
 
53
53
  var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
54
54
 
55
- var _inherits2 = require('babel-runtime/helpers/inherits');
55
+ var _inherits2 = require("babel-runtime/helpers/inherits");
56
56
 
57
57
  var _inherits3 = _interopRequireDefault(_inherits2);
58
58
 
59
- var _form = require('antd/lib/form');
59
+ var _form = require("antd/lib/form");
60
60
 
61
61
  var _form2 = _interopRequireDefault(_form);
62
62
 
63
- require('antd/lib/tooltip/style');
63
+ require("antd/lib/tooltip/style");
64
64
 
65
- require('antd/lib/checkbox/style');
65
+ require("antd/lib/checkbox/style");
66
66
 
67
- require('antd/lib/button/style');
67
+ require("antd/lib/button/style");
68
68
 
69
- require('antd/lib/input/style');
69
+ require("antd/lib/input/style");
70
70
 
71
- require('antd/lib/icon/style');
71
+ require("antd/lib/icon/style");
72
72
 
73
- require('antd/lib/modal/style');
73
+ require("antd/lib/modal/style");
74
74
 
75
- require('antd/lib/form/style');
75
+ require("antd/lib/form/style");
76
76
 
77
- require('isomorphic-fetch');
77
+ require("isomorphic-fetch");
78
78
 
79
- var _react = require('react');
79
+ var _react = require("react");
80
80
 
81
81
  var _react2 = _interopRequireDefault(_react);
82
82
 
83
- require('../../../assets/login/index.less');
83
+ require("../../../assets/login/index.less");
84
84
 
85
- var _login = require('./login.js');
85
+ var _login = require("./login.js");
86
86
 
87
- var _hexSha = require('hex-sha1');
87
+ var _hexSha = require("hex-sha1");
88
88
 
89
89
  var _hexSha2 = _interopRequireDefault(_hexSha);
90
90
 
91
- var _jsencrypt = require('jsencrypt');
91
+ var _jsencrypt = require("jsencrypt");
92
92
 
93
93
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94
94
 
@@ -100,33 +100,35 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
100
100
  * @Description: 新版设计规范学工-登录页面
101
101
  * @Author: lisenlin
102
102
  * @Date: 2020-12-03 20:59:35
103
- * @LastEditors: lisenlin
104
- * @LastEditTime: 2021-12-14 14:31:40
103
+ * @LastEditors: jiangzhongxin
104
+ * @LastEditTime: 2023-11-03 09:44:09
105
105
  */
106
- var pubKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ8DUCb0CEFATRWU8BtBL42RvsdFBcpxYNfsg0P1f7Rd1qKLtqLSBBVGrJu148CdCAkxwKOsjvj5D4eMeDQCd18CAwEAAQ==';
106
+ var pubKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ8DUCb0CEFATRWU8BtBL42RvsdFBcpxYNfsg0P1f7Rd1qKLtqLSBBVGrJu148CdCAkxwKOsjvj5D4eMeDQCd18CAwEAAQ==";
107
107
  //网关密码加密
108
108
 
109
- var URL_PREFIX = ''; //统一前缀
110
- var reqGetCaptcha = URL_PREFIX + 'captchaServlet?v='; //验证码下载路径
109
+ var URL_PREFIX = ""; //统一前缀
110
+ var reqGetCaptcha = URL_PREFIX + "captchaServlet?v="; //验证码下载路径
111
111
  var FormItem = _form2.default.Item;
112
112
 
113
- var defaultLogo = require('../../../assets/login/images/defaultLogo.png');
113
+ var defaultLogo = require("../../../assets/login/images/defaultLogo.png");
114
114
  // const unValidatedPic = require('../../../assets/login/images/yz.png')
115
115
  // const validatedPic = require('../../../assets/login/images/yz_success.png')
116
116
 
117
- var GetCsz = function GetCsz(csbz, callback) {
118
- fetch('front/zhxg-unauth/openapi/getCssz?csbz=' + csbz, {
119
- method: 'GET',
120
- credentials: 'include',
117
+ var baseUrl = window.xtglUrl || "api/hq-xtgl";
118
+
119
+ var getLoginConfig = function getLoginConfig(csbz, callback) {
120
+ fetch(baseUrl + "/outer/logo", {
121
+ method: "GET",
122
+ credentials: "include",
121
123
  headers: {
122
- 'Content-Type': 'application/x-www-form-urlencoded',
123
- 'X-Requested-With': 'XMLHttpRequest',
124
- appId: 'ly-hq'
124
+ "Content-Type": "application/x-www-form-urlencoded",
125
+ "X-Requested-With": "XMLHttpRequest",
126
+ appId: "ly-hq"
125
127
  }
126
128
  }).then(function (response) {
127
129
  return response.json();
128
130
  }).then(function (res) {
129
- if (callback && typeof callback === 'function') {
131
+ if (callback && typeof callback === "function") {
130
132
  callback(res);
131
133
  }
132
134
  return res;
@@ -141,11 +143,21 @@ var LoginPage = function (_React$Component) {
141
143
 
142
144
  var _this = (0, _possibleConstructorReturn3.default)(this, (LoginPage.__proto__ || (0, _getPrototypeOf2.default)(LoginPage)).call(this, props));
143
145
 
144
- _this.getLytype = function () {
146
+ _this.getLoginConfig = function () {
145
147
  try {
146
- GetCsz('XTGL_LYTYPE', function (res) {
148
+ getLoginConfig("", function (res) {
147
149
  if (res && res.code === 200 && res.data) {
148
- _this.setState({ lytype: res.data });
150
+ var title = res.data["XTGL_LOGIN_TITLE"];
151
+ var welcome = res.data["XTGL_LOGIN_WELCOME"];
152
+ var type = res.data["XTGL_LYTYPE"];
153
+ var titleContent = title ? title : _this.state.titleContent;
154
+ var welcomeMsg = welcome ? welcome : _this.state.welcomeMsg;
155
+ var lytype = type ? type : _this.state.lytype;
156
+ _this.setState({
157
+ lytype: lytype,
158
+ titleContent: titleContent,
159
+ welcomeMsg: welcomeMsg
160
+ });
149
161
  }
150
162
  });
151
163
  } catch (err) {}
@@ -178,11 +190,11 @@ var LoginPage = function (_React$Component) {
178
190
  };
179
191
 
180
192
  _this.getCookiePwd = function () {
181
- var uupd = _this.getCookie('dlt-uupd');
182
- if (uupd && uupd !== '') {
183
- var userNameFromCookie = uupd.split('///')[0];
184
- var passwordFromCookie = uupd.split('///')[1];
185
- var privateKey = window.localStorage.getItem('privateKey');
193
+ var uupd = _this.getCookie("dlt-uupd");
194
+ if (uupd && uupd !== "") {
195
+ var userNameFromCookie = uupd.split("///")[0];
196
+ var passwordFromCookie = uupd.split("///")[1];
197
+ var privateKey = window.localStorage.getItem("privateKey");
186
198
  var password = undefined;
187
199
  if (privateKey) {
188
200
  var decrypt = new _jsencrypt.JSEncrypt();
@@ -198,7 +210,7 @@ var LoginPage = function (_React$Component) {
198
210
 
199
211
  _this.handleAccountSubmit = function (e) {
200
212
  e.preventDefault();
201
- if (_this.state.type === 'tab1') {
213
+ if (_this.state.type === "tab1") {
202
214
  _this.props.form.validateFields(function (err, values) {
203
215
  if (!err) {
204
216
  // if(!this.state.validation) {
@@ -211,15 +223,15 @@ var LoginPage = function (_React$Component) {
211
223
  var encryptPassword = encrypt.encrypt(password); //password为需要加密的字段
212
224
  var timestamp = new Date().getTime();
213
225
  var arr = [];
214
- arr.push('username=' + values.username, 'password=' + encryptPassword, 'timestamp=' + timestamp);
215
- var digest = (0, _hexSha2.default)(arr.join(','));
226
+ arr.push("username=" + values.username, "password=" + encryptPassword, "timestamp=" + timestamp);
227
+ var digest = (0, _hexSha2.default)(arr.join(","));
216
228
  //若记住密码 则保存在cookie中,默认保存7天
217
229
  if (_this.state.rememberPW) {
218
230
  var JsEncrypt = new _jsencrypt.JSEncrypt();
219
231
  var privateKey = JsEncrypt.getPrivateKey();
220
- window.localStorage.setItem('privateKey', privateKey);
232
+ window.localStorage.setItem("privateKey", privateKey);
221
233
  var encryptPwd = JsEncrypt.encrypt(password); //password为需要加密的字段
222
- _this.setCookie('dlt-uupd', values.username + '///' + encryptPwd);
234
+ _this.setCookie("dlt-uupd", values.username + "///" + encryptPwd);
223
235
  }
224
236
  var params = {
225
237
  username: values.username,
@@ -227,7 +239,7 @@ var LoginPage = function (_React$Component) {
227
239
  encryptTransfer: true,
228
240
  timestamp: timestamp,
229
241
  digest: digest,
230
- systemId: 'ly-dlt'
242
+ systemId: "ly-hq"
231
243
  };
232
244
  if (_this.state.lytype) {
233
245
  params.lytype = _this.state.lytype;
@@ -254,23 +266,23 @@ var LoginPage = function (_React$Component) {
254
266
 
255
267
  _this.isNotIE = function () {
256
268
  var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
257
- var isIE = userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1; //判断是否IE<11浏览器
258
- var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1;
269
+ var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
270
+ var isIE11 = userAgent.indexOf("Trident") > -1 && userAgent.indexOf("rv:11.0") > -1;
259
271
  if (isIE || isIE11) {
260
272
  return false;
261
273
  } else return true;
262
274
  };
263
275
 
264
276
  _this.getCookie = function (key) {
265
- var name = key + '=';
266
- var ca = document.cookie.split(';');
277
+ var name = key + "=";
278
+ var ca = document.cookie.split(";");
267
279
  for (var i = 0; i < ca.length; i++) {
268
280
  var c = ca[i].trim();
269
281
  if (c.indexOf(name) === 0) {
270
282
  return c.substring(name.length, c.length);
271
283
  }
272
284
  }
273
- return '';
285
+ return "";
274
286
  };
275
287
 
276
288
  _this.setCookie = function (key, value) {
@@ -278,8 +290,8 @@ var LoginPage = function (_React$Component) {
278
290
 
279
291
  var d = new Date();
280
292
  d.setTime(d.getTime() + day * 24 * 60 * 60 * 1000);
281
- var expires = 'expires=' + d.toGMTString();
282
- document.cookie = key + '=' + value + '; ' + expires;
293
+ var expires = "expires=" + d.toGMTString();
294
+ document.cookie = key + "=" + value + "; " + expires;
283
295
  };
284
296
 
285
297
  _this.handelSuccess = function () {
@@ -293,7 +305,7 @@ var LoginPage = function (_React$Component) {
293
305
  validation: false
294
306
  });
295
307
  _this.VerifyRef && _this.VerifyRef.reset();
296
- _this.setCookie('dlt-uupd', '');
308
+ _this.setCookie("dlt-uupd", "");
297
309
  };
298
310
 
299
311
  _this.checkChange = function (checked) {
@@ -303,63 +315,66 @@ var LoginPage = function (_React$Component) {
303
315
  };
304
316
 
305
317
  _this.state = {
306
- type: 'tab1',
318
+ type: "tab1",
307
319
  count: 0,
308
320
  loading: false,
309
- copyright: '', //'Copyright © 2014-2018 LIANYI TECHNOLOGY CO.,LTD. All Rights Reserved. 联奕科技有限公司(V2.0.20170512-31058)',
310
- loginLogoUrl: 'front/zhxg-unauth/xtglSchoolMng/downloadSchoolPictureByType?type=dlylogo',
311
- defaultLoginLogo: 'zhxg',
312
- validateUrl: '',
321
+ copyrightUrl: "",
322
+ copyright: "", //'Copyright © 2014-2018 LIANYI TECHNOLOGY CO.,LTD. All Rights Reserved. 联奕科技有限公司(V2.0.20170512-31058)',
323
+ loginLogoUrl: "front/zhxg-unauth/xtglSchoolMng/downloadSchoolPictureByType?type=dlylogo",
324
+ defaultLoginLogo: "zhxg",
325
+ validateUrl: "",
313
326
  captchaVisible: false, //验证码是否可见
314
- background: require('../../../assets/login/images/bgNew.jpg'), //登录页背景
327
+ background: require("../../../assets/login/images/bgNew.jpg"), //登录页背景
315
328
  browserList: [{
316
- key: '1',
317
- type: 'chrome',
318
- title: '谷歌浏览器',
319
- imgSrc: require('../../../assets/login/images/chrome.png')
329
+ key: "1",
330
+ type: "chrome",
331
+ title: "谷歌浏览器",
332
+ imgSrc: require("../../../assets/login/images/chrome.png")
320
333
  }, {
321
- key: '2',
322
- type: 'firefox',
323
- title: '火狐浏览器',
324
- imgSrc: require('../../../assets/login/images/firefox.png')
334
+ key: "2",
335
+ type: "firefox",
336
+ title: "火狐浏览器",
337
+ imgSrc: require("../../../assets/login/images/firefox.png")
325
338
  }, {
326
- key: '3',
327
- type: 'edge',
328
- title: 'Microsoft Edge浏览器',
329
- imgSrc: require('../../../assets/login/images/edge.png')
339
+ key: "3",
340
+ type: "edge",
341
+ title: "Microsoft Edge浏览器",
342
+ imgSrc: require("../../../assets/login/images/edge.png")
330
343
  }, {
331
- key: '4',
332
- type: '360',
333
- title: '360浏览器',
334
- imgSrc: require('../../../assets/login/images/360.png')
344
+ key: "4",
345
+ type: "360",
346
+ title: "360浏览器",
347
+ imgSrc: require("../../../assets/login/images/360.png")
335
348
  }, {
336
- key: '5',
337
- type: 'safari',
338
- title: 'Safari浏览器',
339
- imgSrc: require('../../../assets/login/images/safari.png')
349
+ key: "5",
350
+ type: "safari",
351
+ title: "Safari浏览器",
352
+ imgSrc: require("../../../assets/login/images/safari.png")
340
353
  }],
341
354
  success: false, //滚动验证
342
- sologanTitle: '联奕愿景',
343
- sologan: '让校园服务更智慧',
355
+ sologanTitle: "联奕愿景",
356
+ sologan: "让校园服务更智慧",
344
357
  rememberPW: true, //是否记住密码
345
358
  userNameFromCookie: undefined, //cookie缓存的登录者
346
359
  passwordFromCookie: undefined, //cookie缓存的登录密码 - 不加密
347
360
  validation: false, //验证状态
348
361
  smallScreen: false, //是否屏幕宽度较小 <700为true
349
362
  shortScreen: false, //是否屏幕高度较矮 <750为true
350
- lytype: '' // 登录接口处理
363
+ lytype: "", // 登录接口处理
364
+ titleContent: "学生工作管理系统",
365
+ welcomeMsg: "欢迎使用"
351
366
  };
352
367
  return _this;
353
368
  }
354
369
 
355
370
  (0, _createClass3.default)(LoginPage, [{
356
- key: 'UNSAFE_componentWillMount',
371
+ key: "UNSAFE_componentWillMount",
357
372
  value: function UNSAFE_componentWillMount() {
358
373
  var _this2 = this;
359
374
 
360
375
  //获取版权信息
361
- if (this.props.config.copyright && this.props.config.copyright.startsWith('front/')) {
362
- (0, _NHFetch3.default)(this.props.config.copyright, 'GET').then(function (res) {
376
+ if (this.props.config.copyright && this.props.config.copyright.startsWith("api/")) {
377
+ (0, _NHFetch3.default)(this.props.config.copyright, "GET").then(function (res) {
363
378
  if (res) {
364
379
  _this2.setState({
365
380
  copyright: res.data,
@@ -375,33 +390,33 @@ var LoginPage = function (_React$Component) {
375
390
  }
376
391
  this.getSetting(); //获取配置,是否开启验证码
377
392
  this.getCookiePwd(); //获取cookie的账密
378
- this.getLytype(); //获取登录类型
379
- window.addEventListener('resize', this.handelWindowResize);
393
+ this.getLoginConfig(); //获取登录类型
394
+ window.addEventListener("resize", this.handelWindowResize);
380
395
  }
381
396
  }, {
382
- key: 'componentWillUnmount',
397
+ key: "componentWillUnmount",
383
398
  value: function componentWillUnmount() {
384
- window.removeEventListener('resize', this.handelWindowResize);
399
+ window.removeEventListener("resize", this.handelWindowResize);
385
400
  }
386
401
  /**获取lytype值 */
387
402
 
388
403
  /** 监听屏幕宽度 */
389
404
 
390
405
  }, {
391
- key: 'getSetting',
406
+ key: "getSetting",
392
407
 
393
408
 
394
409
  //获取配置,是否开启验证码
395
410
  value: function getSetting() {
396
411
  var _this3 = this;
397
412
 
398
- fetch(URL_PREFIX + 'ng/captcha/status', {
399
- method: 'GET',
400
- credentials: 'include',
413
+ fetch(URL_PREFIX + "ng/captcha/status", {
414
+ method: "GET",
415
+ credentials: "include",
401
416
  headers: {
402
- 'Content-Type': 'application/x-www-form-urlencoded',
403
- 'X-Requested-With': 'XMLHttpRequest',
404
- appId: 'ly-hq'
417
+ "Content-Type": "application/x-www-form-urlencoded",
418
+ "X-Requested-With": "XMLHttpRequest",
419
+ appId: "ly-hq"
405
420
  }
406
421
  }).then(function (response) {
407
422
  return response.json();
@@ -422,12 +437,15 @@ var LoginPage = function (_React$Component) {
422
437
  return res;
423
438
  }).catch(function (error) {
424
439
  // 网络请求失败返回执行该回调函数,得到错误信息
425
- _modal2.default.error({ title: '错误提示', content: '网络请求异常,请联系管理员' });
440
+ _modal2.default.error({
441
+ title: "错误提示",
442
+ content: "网络请求异常,请联系管理员"
443
+ });
426
444
  return error;
427
445
  });
428
446
  }
429
447
  }, {
430
- key: 'changeCaptcha',
448
+ key: "changeCaptcha",
431
449
  value: function changeCaptcha() {
432
450
  this.setState({
433
451
  validateUrl: reqGetCaptcha + new Date().getMilliseconds()
@@ -446,7 +464,7 @@ var LoginPage = function (_React$Component) {
446
464
  /** 登录失败重置滑动认证器 并清除cookie的登录缓存 */
447
465
 
448
466
  }, {
449
- key: 'render',
467
+ key: "render",
450
468
  value: function render() {
451
469
  var _this4 = this;
452
470
 
@@ -463,62 +481,64 @@ var LoginPage = function (_React$Component) {
463
481
  userNameFromCookie = _state.userNameFromCookie,
464
482
  passwordFromCookie = _state.passwordFromCookie,
465
483
  smallScreen = _state.smallScreen,
466
- rememberPW = _state.rememberPW;
484
+ rememberPW = _state.rememberPW,
485
+ titleContent = _state.titleContent,
486
+ welcomeMsg = _state.welcomeMsg;
467
487
 
468
- var styleObj = smallScreen ? {} : { paddingLeft: '195px' };
488
+ var styleObj = smallScreen ? {} : { paddingLeft: "195px" };
469
489
  return _react2.default.createElement(
470
- 'div',
490
+ "div",
471
491
  {
472
- className: 'xgui-newLogin',
473
- style: { backgroundImage: 'url(' + background + ')' }
492
+ className: "xgui-newLogin",
493
+ style: { backgroundImage: "url(" + background + ")" }
474
494
  },
475
495
  _react2.default.createElement(
476
- 'div',
477
- { className: 'xgui-newlogin-content' },
496
+ "div",
497
+ { className: "xgui-newlogin-content" },
478
498
  _react2.default.createElement(
479
- 'div',
480
- { className: 'xgui-login-title', style: styleObj },
481
- _react2.default.createElement('img', {
482
- className: 'logo',
499
+ "div",
500
+ { className: "xgui-login-title", style: styleObj },
501
+ _react2.default.createElement("img", {
502
+ className: "logo",
483
503
  src: config.loginLogoUrl,
484
504
  onError: function onError(e) {
485
505
  e.target.value === defaultLogo;
486
506
  }
487
507
  }),
488
- _react2.default.createElement('span', { className: 'split' }),
508
+ _react2.default.createElement("span", { className: "split" }),
489
509
  _react2.default.createElement(
490
- 'span',
491
- { className: 'titleContnet' },
492
- '学生工作管理系统'
510
+ "span",
511
+ { className: "titleContnet" },
512
+ titleContent
493
513
  )
494
514
  ),
495
515
  _react2.default.createElement(
496
- 'div',
497
- { className: 'xgui-loginMain' },
516
+ "div",
517
+ { className: "xgui-loginMain" },
498
518
  !smallScreen && _react2.default.createElement(
499
- 'div',
519
+ "div",
500
520
  {
501
- className: 'xgui-login-slogan',
502
- style: { visibility: 'hidden' }
521
+ className: "xgui-login-slogan",
522
+ style: { visibility: "hidden" }
503
523
  },
504
524
  _react2.default.createElement(
505
- 'div',
506
- { className: 'sloganTitle' },
525
+ "div",
526
+ { className: "sloganTitle" },
507
527
  sologanTitle
508
528
  ),
509
529
  _react2.default.createElement(
510
- 'div',
511
- { className: 'slogan' },
530
+ "div",
531
+ { className: "slogan" },
512
532
  sologan
513
533
  )
514
534
  ),
515
535
  _react2.default.createElement(
516
- 'div',
517
- { className: 'xgui-login-loginWarp' },
536
+ "div",
537
+ { className: "xgui-login-loginWarp" },
518
538
  _react2.default.createElement(
519
- 'p',
520
- { className: 'welcomeMsg' },
521
- '\u6B22\u8FCE\u4F7F\u7528'
539
+ "p",
540
+ { className: "welcomeMsg" },
541
+ welcomeMsg
522
542
  ),
523
543
  _react2.default.createElement(
524
544
  _form2.default,
@@ -526,31 +546,31 @@ var LoginPage = function (_React$Component) {
526
546
  _react2.default.createElement(
527
547
  FormItem,
528
548
  null,
529
- getFieldDecorator('username', {
549
+ getFieldDecorator("username", {
530
550
  initialValue: userNameFromCookie,
531
- rules: [{ required: true, message: '请输入您的账号!' }]
551
+ rules: [{ required: true, message: "请输入您的账号!" }]
532
552
  })(_react2.default.createElement(_input2.default, {
533
- size: 'large',
553
+ size: "large",
534
554
  prefix: _react2.default.createElement(_icon2.default, {
535
- type: 'user',
536
- style: { color: 'rgba(0,0,0,.25)' }
555
+ type: "user",
556
+ style: { color: "rgba(0,0,0,.25)" }
537
557
  }),
538
- placeholder: '\u8BF7\u8F93\u5165\u7528\u6237\u540D'
558
+ placeholder: "\u8BF7\u8F93\u5165\u7528\u6237\u540D"
539
559
  }))
540
560
  ),
541
561
  _react2.default.createElement(
542
562
  FormItem,
543
563
  null,
544
- getFieldDecorator('password', {
564
+ getFieldDecorator("password", {
545
565
  initialValue: passwordFromCookie,
546
- rules: [{ required: true, message: '请输入密码!' }]
566
+ rules: [{ required: true, message: "请输入密码!" }]
547
567
  })(_react2.default.createElement(_input2.default.Password, {
548
- size: 'large',
568
+ size: "large",
549
569
  prefix: _react2.default.createElement(_icon2.default, {
550
- type: 'lock',
551
- style: { color: 'rgba(0,0,0,.25)' }
570
+ type: "lock",
571
+ style: { color: "rgba(0,0,0,.25)" }
552
572
  }),
553
- placeholder: '\u8BF7\u8F93\u5165\u5BC6\u7801'
573
+ placeholder: "\u8BF7\u8F93\u5165\u5BC6\u7801"
554
574
  })
555
575
  // <LyPassword
556
576
  // encryptMark='*'
@@ -564,27 +584,27 @@ var LoginPage = function (_React$Component) {
564
584
  this.state.captchaVisible ? _react2.default.createElement(
565
585
  FormItem,
566
586
  null,
567
- getFieldDecorator('captcha', {
568
- rules: [{ required: true, message: '请输入验证码!' }]
587
+ getFieldDecorator("captcha", {
588
+ rules: [{ required: true, message: "请输入验证码!" }]
569
589
  })(_react2.default.createElement(
570
- 'div',
571
- { className: 'captchaItem' },
590
+ "div",
591
+ { className: "captchaItem" },
572
592
  _react2.default.createElement(_input2.default, {
573
- className: 'captcha_input',
574
- size: 'large',
575
- type: 'text',
576
- placeholder: '\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801'
593
+ className: "captcha_input",
594
+ size: "large",
595
+ type: "text",
596
+ placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"
577
597
  }),
578
598
  _react2.default.createElement(
579
- 'div',
599
+ "div",
580
600
  null,
581
601
  _react2.default.createElement(
582
- 'span',
602
+ "span",
583
603
  { onClick: function onClick() {
584
604
  return _this4.changeCaptcha();
585
605
  } },
586
- _react2.default.createElement('img', {
587
- className: 'captcha_value',
606
+ _react2.default.createElement("img", {
607
+ className: "captcha_value",
588
608
  src: this.state.validateUrl
589
609
  })
590
610
  )
@@ -597,47 +617,47 @@ var LoginPage = function (_React$Component) {
597
617
  _react2.default.createElement(
598
618
  _button2.default,
599
619
  {
600
- className: 'xgui-nwelogin-submit',
601
- type: 'primary',
602
- size: 'large',
603
- htmlType: 'submit',
620
+ className: "xgui-nwelogin-submit",
621
+ type: "primary",
622
+ size: "large",
623
+ htmlType: "submit",
604
624
  loading: this.state.loading
605
625
  },
606
- '\u767B\u5F55'
626
+ "\u767B\u5F55"
607
627
  )
608
628
  ),
609
629
  _react2.default.createElement(
610
630
  FormItem,
611
- { style: { marginTop: '-20px' } },
612
- getFieldDecorator('remember', {
613
- valuePropName: 'checked',
631
+ { style: { marginTop: "-20px" } },
632
+ getFieldDecorator("remember", {
633
+ valuePropName: "checked",
614
634
  initialValue: rememberPW
615
635
  })(_react2.default.createElement(
616
636
  _checkbox2.default,
617
637
  {
618
- style: { float: 'left' },
638
+ style: { float: "left" },
619
639
  onChange: function onChange(e) {
620
640
  return _this4.checkChange(e.target.checked);
621
641
  }
622
642
  },
623
- '\u8BB0\u4F4F\u767B\u5F55'
643
+ "\u8BB0\u4F4F\u767B\u5F55"
624
644
  ))
625
645
  ),
626
- _react2.default.createElement('div', null)
646
+ _react2.default.createElement("div", null)
627
647
  ),
628
648
  _react2.default.createElement(
629
- 'div',
630
- { className: 'xgui-nwelogin-recomment' },
649
+ "div",
650
+ { className: "xgui-nwelogin-recomment" },
631
651
  _react2.default.createElement(
632
- 'span',
652
+ "span",
633
653
  null,
634
- '\u5EFA\u8BAE\u4F7F\u7528\u6D4F\u89C8\u5668\uFF1A'
654
+ "\u5EFA\u8BAE\u4F7F\u7528\u6D4F\u89C8\u5668\uFF1A"
635
655
  ),
636
656
  browserList.map(function (item) {
637
657
  return _react2.default.createElement(
638
658
  _tooltip2.default,
639
659
  { title: item.title },
640
- _react2.default.createElement('img', { src: item.imgSrc, width: 24 })
660
+ _react2.default.createElement("img", { src: item.imgSrc, width: 24 })
641
661
  );
642
662
  })
643
663
  )
@@ -645,8 +665,8 @@ var LoginPage = function (_React$Component) {
645
665
  )
646
666
  ),
647
667
  _react2.default.createElement(
648
- 'div',
649
- { className: 'xgui-nwelogin-copyright' },
668
+ "div",
669
+ { className: "xgui-nwelogin-copyright" },
650
670
  copyright
651
671
  )
652
672
  );
@@ -77,8 +77,8 @@ var userLogin = exports.userLogin = function userLogin(allMenu, params, func) {
77
77
  headers: {
78
78
  'Content-Type': 'application/x-www-form-urlencoded',
79
79
  'X-Requested-With': 'XMLHttpRequest',
80
- logAppId: 'ly-sm',
81
- gatewayAppId: 'ly-sm',
80
+ logAppId: 'ly-hq',
81
+ gatewayAppId: 'ly-hq',
82
82
  logServiceId: window.logServiceId
83
83
  },
84
84
  body: querystring.stringify(params)
@@ -276,7 +276,7 @@ var getDifferDate = exports.getDifferDate = function getDifferDate(firstDate, se
276
276
  * 获取已经登录的用户信息
277
277
  * @param func
278
278
  */
279
- var tryLoginUserInfo = exports.tryLoginUserInfo = function tryLoginUserInfo(allMenu, fullPageUrl, func, Authorization) {
279
+ var tryLoginUserInfo = exports.tryLoginUserInfo = function tryLoginUserInfo(allMenu, fullPageUrl, func, Authorization, notConf) {
280
280
  //第一步,清空缓存
281
281
  ////console.info("tryLoginUserInfo执行1");
282
282
  if (window.gateway_version === '2') {
@@ -295,15 +295,15 @@ var tryLoginUserInfo = exports.tryLoginUserInfo = function tryLoginUserInfo(allM
295
295
  'Content-Type': 'application/x-www-form-urlencoded',
296
296
  'X-Requested-With': 'XMLHttpRequest',
297
297
  Authorization: Authorization || '',
298
- logAppId: 'ly-sm',
299
- gatewayAppId: 'ly-sm',
298
+ logAppId: 'ly-hq',
299
+ gatewayAppId: 'ly-hq',
300
300
  logServiceId: window.logServiceId
301
301
  },
302
302
  redirect: 'manual'
303
303
  }).then(function (response) {
304
304
  return response.json();
305
305
  }).then(function (res) {
306
- ////console.info("tryLoginUserInfo执行5");
306
+ //console.info("tryLoginUserInfo执行5");
307
307
  if (window.gateway_version === '2') {
308
308
  if (res.meta && res.meta.statusCode === 200) {
309
309
  if (res.data) {
@@ -350,7 +350,7 @@ var tryLoginUserInfo = exports.tryLoginUserInfo = function tryLoginUserInfo(allM
350
350
  return res;
351
351
  }
352
352
  } else {
353
- ////console.info("tryLoginUserInfo执行5");
353
+ //console.info("tryLoginUserInfo执行5");
354
354
  if (res.meta && res.meta.statusCode === 200) {
355
355
  //console.info("tryLoginUserInfo执行3");
356
356
  if (res.data) {
@@ -363,7 +363,7 @@ var tryLoginUserInfo = exports.tryLoginUserInfo = function tryLoginUserInfo(allM
363
363
  sessionStorage.setItem('statusCode', res.meta.statusCode);
364
364
  }
365
365
  //console.info("tryLoginUserInfo执行4");
366
- sso(func);
366
+ sso(func, undefined, notConf);
367
367
  return res;
368
368
  }
369
369
  }).catch(function (error) {
@@ -450,18 +450,18 @@ var tryAllConfigInfo = exports.tryAllConfigInfo = function tryAllConfigInfo(func
450
450
  };
451
451
 
452
452
  //单点登录验证
453
- var sso = function sso(func, allMenu) {
453
+ var sso = function sso(func, allMenu, notConf) {
454
454
  //console.info("sso执行1");
455
455
  var userLogin = sessionStorage.getItem('userLogin');
456
456
 
457
457
  if (userLogin) {
458
458
  //如果已经登录,此时需要获取配置信息
459
459
  //console.info("sso执行2");
460
- tryAllConfigInfo(function () {
461
- if (func) {
462
- func();
463
- }
464
- });
460
+ if (!notConf) {
461
+ tryAllConfigInfo(func);
462
+ return;
463
+ }
464
+ func && func();
465
465
  } else {
466
466
  //是否启用单点登录
467
467
  if (window.casStatus) {
@@ -558,9 +558,7 @@ var sso = function sso(func, allMenu) {
558
558
  window.location = window.location.origin + window.location.pathname + 'auth?service=' + urlencode(window.location.origin + window.location.pathname);
559
559
  }
560
560
  } else {
561
- if (func) {
562
- func();
563
- }
561
+ func && func();
564
562
  }
565
563
  }
566
564
  };
@@ -201,7 +201,7 @@ var Home = function (_React$Component) {
201
201
 
202
202
  //修改密码
203
203
  var baseUrl = window.xtglUrl || 'api/hq-xtgl';
204
- (0, _NHFetch3.default)(baseUrl + '/openapi/users/password/update?oldPassword=' + oldPwd + '&newPassword=' + newPwd, 'post', {}).then(function (res) {
204
+ (0, _NHFetch3.default)(baseUrl + '/outer/users/password/update?oldPassword=' + oldPwd + '&newPassword=' + newPwd, 'post', {}).then(function (res) {
205
205
  if (res && res.data.meta['success']) {
206
206
  _this.passWordForm.resetFields();
207
207
  _this.nhEditPassWordModal.close();
@@ -129,7 +129,7 @@ var NHLayout = function (_React$Component) {
129
129
  _this.getLayoutSetting = function () {
130
130
  _this.setState({ layoutShow: false });
131
131
  var baseUrl = window.xtglUrl || 'api/hq-xtgl';
132
- (0, _NHFetch3.default)(baseUrl + '/openapi/getCsszByCsbz', 'GET', {
132
+ (0, _NHFetch3.default)(baseUrl + '/outer/getCsszByCsbz', 'GET', {
133
133
  csbz: 'XTGL_LAYOUT_SETTING'
134
134
  }).then(function (res) {
135
135
  if (res && res.code === 200 && res.data) {
@@ -192,7 +192,7 @@ var MixTop = function (_React$Component) {
192
192
  var oldPwd = (0, _rsa.encryptedString)(key, oldPassWord);
193
193
  var baseUrl = window.xtglUrl || 'api/hq-xtgl';
194
194
  //修改密码
195
- (0, _NHFetch3.default)(baseUrl + '/openapi/users/password/update?oldPassword=' + oldPwd + '&newPassword=' + newPwd, 'post', {}).then(function (res) {
195
+ (0, _NHFetch3.default)(baseUrl + '/outer/users/password/update?oldPassword=' + oldPwd + '&newPassword=' + newPwd, 'post', {}).then(function (res) {
196
196
  if (res && res.data.meta['success']) {
197
197
  _this.passWordForm.resetFields();
198
198
  _this.nhEditPassWordModal.close();
@@ -224,7 +224,7 @@ var validateCode = exports.validateCode = function () {
224
224
 
225
225
  baseUrl = window.xtglUrl || 'api/hq-xtgl';
226
226
  _context.next = 6;
227
- return NHFetch(baseUrl + '/openapi/getCsszByCsbz', 'GET', {
227
+ return NHFetch(baseUrl + '/outer/getCsszByCsbz', 'GET', {
228
228
  csbz: 'XTGL_TSZF'
229
229
  });
230
230
 
@@ -451,7 +451,9 @@ var NHFetch = function NHFetch(pUrl, pMethod, params, errorFunc) {
451
451
  //在此处统一对后台抛出来的异常进行处理
452
452
  return undefined;
453
453
  }).catch(function (error) {
454
- return error;
454
+ console.log('请求异常:', error.message);
455
+ _message3.default.error('系统出现异常,请联系管理员!');
456
+ return;
455
457
  });
456
458
  };
457
459
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlt-for-react",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "dlt for react",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {