cloud-web-corejs 1.0.258 → 1.0.260

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.
Files changed (249) hide show
  1. package/package.json +32 -25
  2. package/src/components/VabUpload/fileLibraryDialog.vue +296 -0
  3. package/src/components/VabUpload/index.js +22 -2
  4. package/src/components/VabUpload/index.vue +242 -231
  5. package/src/components/VabUpload/mixins/fileLibraryDialog.js +1112 -0
  6. package/src/components/VabUpload/mixins.js +1971 -1829
  7. package/src/components/VabUpload/privateProfileDialog.vue +2 -2
  8. package/src/components/baseArea/index.vue +1628 -0
  9. package/src/components/baseInputExport/mixins.js +48 -31
  10. package/src/components/baseInputNumber/index.vue +9 -9
  11. package/src/components/baseTabs/index.vue +16 -8
  12. package/src/components/code-editor/async.js +29 -0
  13. package/src/components/code-editor/index.vue +93 -4
  14. package/src/components/errorMsg/index.js +10 -9
  15. package/src/components/errorMsg/mixins.js +25 -23
  16. package/src/components/excelExport/exportFieldDialog.vue +40 -18
  17. package/src/components/excelExport/index.js +62 -3
  18. package/src/components/excelExport/index.vue +2 -1
  19. package/src/components/excelExport/mixins.js +496 -340
  20. package/src/components/excelImport/index.js +69 -7
  21. package/src/components/excelImport/mixins.js +841 -9
  22. package/src/components/fileLibrary/categoryMoveDialog.vue +109 -109
  23. package/src/components/fileLibrary/fileHistoryDialog.vue +1 -1
  24. package/src/components/fileLibrary/fileObjAuthDialog.vue +297 -298
  25. package/src/components/fileLibrary/fileObjAuthEdit.vue +1 -1
  26. package/src/components/fileLibrary/filterDialog.vue +1 -1
  27. package/src/components/fileLibrary/index.vue +1109 -1110
  28. package/src/components/fileLibrary/mixins/indexMixins.js +10 -0
  29. package/src/components/fileLibrary/propertiesDialog.vue +190 -190
  30. package/src/components/fileLibrary/recycleBinDialog.vue +237 -236
  31. package/src/components/formOplog/mixins.js +85 -80
  32. package/src/components/hiprint/view/design/index.vue +7 -2
  33. package/src/components/jsonImport/exportUtil.js +106 -0
  34. package/src/components/jsonImport/index.js +75 -50
  35. package/src/components/jsonImport/mixins.js +350 -348
  36. package/src/components/langImport/mixins.js +502 -500
  37. package/src/components/micro-view-host/contract.js +66 -0
  38. package/src/components/micro-view-host/index.vue +148 -0
  39. package/src/components/mobile/file/index.vue +10 -0
  40. package/src/components/mobile/wf/mixins/wfModifyDialogMixin.js +51 -47
  41. package/src/components/obsUpload/index.vue +234 -231
  42. package/src/components/obsUpload/mixins.js +1542 -1476
  43. package/src/components/onlineTalk/talkUserDialog.vue +1 -1
  44. package/src/components/table/CellSlot.vue +12 -10
  45. package/src/components/table/config.js +74 -1
  46. package/src/components/table/index.js +1209 -1
  47. package/src/components/table/tableForm.vue +4 -2
  48. package/src/components/table/tableFormMixin.js +285 -1
  49. package/src/components/table/util/index.js +38 -40
  50. package/src/components/table/vxeFilter/index.js +153 -2
  51. package/src/components/table/vxeFilter/mixin.js +305 -3
  52. package/src/components/tempStorage/tempStorageDialog.vue +1 -1
  53. package/src/components/vb-tabs/x-tabs.vue +10 -5
  54. package/src/components/wf/addTaskUserdialog.vue +1 -1
  55. package/src/components/wf/mixins/setCandidateDialog.js +217 -217
  56. package/src/components/wf/mixins/setCandidateDialog2.js +252 -252
  57. package/src/components/wf/wf.js +2224 -2203
  58. package/src/components/wf/wfUtil.js +2 -1
  59. package/src/components/xform/docs/2026-08 /345/210/227/350/241/250/345/257/274/345/207/272/350/204/261/346/225/217/345/210/227/345/211/224/351/231/244/350/220/275/345/234/260/346/226/207/346/241/243.md" +173 -0
  60. package/src/components/xform/form-designer/designer.js +1 -0
  61. package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +110 -1
  62. package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +282 -1
  63. package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +272 -0
  64. package/src/components/xform/form-designer/form-widget/field-widget/autocomplete-widget.vue +119 -0
  65. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +14 -0
  66. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +18 -73
  67. package/src/components/xform/form-designer/form-widget/field-widget/mixins/autocomplete-mixin.js +451 -0
  68. package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +157 -0
  69. package/src/components/xform/form-designer/form-widget/field-widget/mixins/utc-transform-mixin.js +75 -0
  70. package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +112 -0
  71. package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +149 -0
  72. package/src/components/xform/form-designer/form-widget/indexMixin.js +179 -1
  73. package/src/components/xform/form-designer/indexMixin.js +823 -1
  74. package/src/components/xform/form-designer/refMixinDesign.js +27 -1
  75. package/src/components/xform/form-designer/setting-panel/action-button-config-dialog.vue +241 -0
  76. package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +601 -0
  77. package/src/components/xform/form-designer/setting-panel/form-setting.vue +6 -0
  78. package/src/components/xform/form-designer/setting-panel/index.vue +314 -309
  79. package/src/components/xform/form-designer/setting-panel/indexMixin.js +324 -1
  80. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +8 -7
  81. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +8 -7
  82. package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +344 -0
  83. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +2 -2
  84. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +25 -0
  85. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -0
  86. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +20 -0
  87. package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +199 -0
  88. package/src/components/xform/form-designer/setting-panel/property-editor/field-baseAttachment/baseAttachment-fileTypes-editor.vue +23 -0
  89. package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/showAllLevels-editor.vue +21 -0
  90. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +157 -0
  91. package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +55 -0
  92. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/vabUpload-fileTypes-editor.vue +23 -0
  93. package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesEditorMixin.js +116 -0
  94. package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -0
  95. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +3 -3
  96. package/src/components/xform/form-designer/setting-panel/property-editor/utcTransformEnabled-editor.vue +19 -0
  97. package/src/components/xform/form-designer/setting-panel/widgetPropertyDialogMixin.js +186 -0
  98. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +566 -1
  99. package/src/components/xform/form-designer/widget-panel/indexMixin.js +290 -1
  100. package/src/components/xform/form-render/compareDelList.vue +83 -0
  101. package/src/components/xform/form-render/compareView.vue +76 -0
  102. package/src/components/xform/form-render/container-item/containerItemMixin.js +378 -1
  103. package/src/components/xform/form-render/container-item/data-table-mixin.js +35 -0
  104. package/src/components/xform/form-render/container-item/detail-item.vue +41 -0
  105. package/src/components/xform/form-render/container-item/dynamicFieldEngine.js +285 -0
  106. package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +416 -0
  107. package/src/components/xform/form-render/container-item/list-h5-item.vue +12 -0
  108. package/src/components/xform/form-render/dynamicDialogRender.js +195 -1
  109. package/src/components/xform/form-render/dynamicDrawerRender.js +229 -0
  110. package/src/components/xform/form-render/formDynamicFieldMixin.js +131 -0
  111. package/src/components/xform/form-render/refMixin.js +29 -1
  112. package/src/components/xform/mixins/scriptHttp.js +172 -1
  113. package/src/components/xform/utils/dynamicSchemaUtil.js +361 -0
  114. package/src/components/xform/utils/tableCellValidateUtil.js +148 -0
  115. package/src/components/xform/utils/textMaskUtil.js +179 -0
  116. package/src/components/xform/utils/treeTableUtil.js +1265 -0
  117. package/src/components/xform/utils/util.js +1 -0
  118. package/src/components/xform/utils/validators.js +133 -1
  119. package/src/directive/LimitNumber/index.js +143 -124
  120. package/src/microRouter/index.js +447 -0
  121. package/src/mixins/tableTree/index.js +77 -14
  122. package/src/permission.js +132 -107
  123. package/src/public-path.js +38 -0
  124. package/src/router/index.js +3 -3
  125. package/src/store/modules/micro.js +57 -0
  126. package/src/store/modules/permission.js +535 -371
  127. package/src/store/modules/tagsView.js +38 -21
  128. package/src/store/modules/user.js +409 -370
  129. package/src/utils/aes.js +9 -3
  130. package/src/utils/auth.js +1 -1
  131. package/src/utils/componentDialog.js +162 -40
  132. package/src/utils/global.js +35 -34
  133. package/src/utils/index.js +579 -579
  134. package/src/utils/keepAlive.js +8 -4
  135. package/src/utils/lazyPlugin.js +66 -0
  136. package/src/utils/menuAdapter.js +277 -0
  137. package/src/utils/repeatOpen.js +48 -0
  138. package/src/utils/request.js +417 -395
  139. package/src/utils/resolveViewComponent.js +203 -0
  140. package/src/utils/vab.js +14 -3
  141. package/src/utils/validate.js +104 -106
  142. package/src/views/bd/setting/bd_attach_setting/dialog.vue +1 -1
  143. package/src/views/bd/setting/bd_attach_setting/list.vue +1 -1
  144. package/src/views/bd/setting/bd_company_env/dialog.vue +1 -1
  145. package/src/views/bd/setting/bd_company_env/list.vue +1 -1
  146. package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +488 -489
  147. package/src/views/bd/setting/form_import_log/list.vue +1 -1
  148. package/src/views/bd/setting/form_script/dialog.vue +1 -1
  149. package/src/views/bd/setting/form_script/form_list.vue +174 -166
  150. package/src/views/bd/setting/form_script/list.vue +1 -1
  151. package/src/views/bd/setting/form_script/list1.vue +1 -1
  152. package/src/views/bd/setting/form_script/mixins/form_list.js +330 -322
  153. package/src/views/bd/setting/form_template/dialog.vue +1 -1
  154. package/src/views/bd/setting/form_template/formDesignerDialog.vue +172 -171
  155. package/src/views/bd/setting/form_template/ftHistoryDialog.vue +1 -1
  156. package/src/views/bd/setting/form_template/itemList.vue +1 -1
  157. package/src/views/bd/setting/form_template/list.vue +3 -3
  158. package/src/views/bd/setting/form_template/mixins/edit.js +3 -3
  159. package/src/views/bd/setting/form_template/mixins/list.js +3 -3
  160. package/src/views/bd/setting/form_template/mixins/list2.js +3 -3
  161. package/src/views/bd/setting/form_template/mixins/wf_list.js +3 -3
  162. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +253 -254
  163. package/src/views/bd/setting/form_template/wf_list.vue +3 -3
  164. package/src/views/bd/setting/logic_param/edit.vue +20 -20
  165. package/src/views/bd/setting/logic_param/list.vue +1 -1
  166. package/src/views/bd/setting/menu_kind/dialog.vue +1 -1
  167. package/src/views/bd/setting/menu_kind/list.vue +1 -1
  168. package/src/views/bd/setting/push_data/list.vue +1 -1
  169. package/src/views/bd/setting/push_data_h/list.vue +1 -1
  170. package/src/views/bd/setting/request_async_setting/list.vue +1 -1
  171. package/src/views/bd/setting/request_setting/list.vue +1 -1
  172. package/src/views/bd/setting/table_model/dialog.vue +1 -1
  173. package/src/views/bd/setting/table_model/list.vue +1 -1
  174. package/src/views/bd/setting/table_model/zdDialog.vue +1 -1
  175. package/src/views/user/access_log/list.vue +1 -1
  176. package/src/views/user/access_log/list2.vue +1 -1
  177. package/src/views/user/api_request/list.vue +1 -1
  178. package/src/views/user/area/dialog.vue +1 -1
  179. package/src/views/user/area/list.vue +1 -1
  180. package/src/views/user/bill_setting/list.vue +1 -1
  181. package/src/views/user/bill_setting/userDialog.vue +1 -1
  182. package/src/views/user/code_rules/list.vue +1 -1
  183. package/src/views/user/commMenu/index.vue +2 -2
  184. package/src/views/user/common_attribute/list.vue +2 -2
  185. package/src/views/user/common_script/list.vue +1 -1
  186. package/src/views/user/company_info/dialog.vue +1 -1
  187. package/src/views/user/country/dialog.vue +1 -1
  188. package/src/views/user/country/list.vue +1 -1
  189. package/src/views/user/data_type_setting/dialog.vue +1 -1
  190. package/src/views/user/extend_datasource/dialog.vue +4 -1
  191. package/src/views/user/extend_datasource/edit.vue +2 -1
  192. package/src/views/user/extend_datasource/list.vue +4 -1
  193. package/src/views/user/fieldTranslation/list.vue +1 -1
  194. package/src/views/user/field_values_invisible/list.vue +1 -1
  195. package/src/views/user/file_type/list.vue +1 -1
  196. package/src/views/user/file_view_area/list.vue +1 -1
  197. package/src/views/user/file_view_ins/list.vue +22 -1
  198. package/src/views/user/form/view/list.vue +64 -1
  199. package/src/views/user/groups/dialog.vue +1 -1
  200. package/src/views/user/groups/list.vue +1 -1
  201. package/src/views/user/home/default.vue +2 -2
  202. package/src/views/user/home/default2.vue +1158 -1148
  203. package/src/views/user/home/index.vue +3 -10
  204. package/src/views/user/lang_tag/dialog.vue +1 -1
  205. package/src/views/user/lang_tag/list.vue +1 -1
  206. package/src/views/user/language_setting/list.vue +1 -1
  207. package/src/views/user/login/default.vue +0 -8
  208. package/src/views/user/login/indexMixin.js +547 -556
  209. package/src/views/user/menu/list.vue +25 -2
  210. package/src/views/user/menuFallback/index.vue +123 -0
  211. package/src/views/user/mobile_menu/list.vue +1 -1
  212. package/src/views/user/notify_message/dialog.vue +22 -1
  213. package/src/views/user/notify_message/list.vue +1 -1
  214. package/src/views/user/notify_template/list.vue +1 -1
  215. package/src/views/user/notify_template/list2.vue +1 -1
  216. package/src/views/user/oplog/list.vue +1 -1
  217. package/src/views/user/outLink/form_view.vue +5 -14
  218. package/src/views/user/outLink/index.vue +6 -1
  219. package/src/views/user/outLink/view.vue +5 -13
  220. package/src/views/user/position/dialog.vue +1 -1
  221. package/src/views/user/position/list.vue +1 -1
  222. package/src/views/user/project_tag/dialog.vue +1 -1
  223. package/src/views/user/project_tag/list.vue +1 -1
  224. package/src/views/user/push_setting/list.vue +1 -1
  225. package/src/views/user/request_setting/list.vue +1 -1
  226. package/src/views/user/role/dialog.vue +1 -1
  227. package/src/views/user/role/list.vue +1 -1
  228. package/src/views/user/sale_org/dialog.vue +1 -1
  229. package/src/views/user/sale_org/list.vue +1 -1
  230. package/src/views/user/system_notice/list.vue +1 -1
  231. package/src/views/user/system_parameter/list.vue +1 -1
  232. package/src/views/user/user/dialog.vue +1 -1
  233. package/src/views/user/user/edit.vue +306 -159
  234. package/src/views/user/user/form_dialog.vue +1 -1
  235. package/src/views/user/user/form_list.vue +1 -1
  236. package/src/views/user/user/list.vue +2 -2
  237. package/src/views/user/user_log_classify/list.vue +1 -1
  238. package/src/views/user/wf/iframe/index.vue +6 -1
  239. package/src/views/user/wf/iframe/index2.vue +6 -1
  240. package/src/views/user/wf/wfReport/index.vue +12 -6
  241. package/src/views/user/wf/wf_auto_submit_data/list.vue +2 -2
  242. package/src/views/user/wf/wf_manage/list.vue +97 -24
  243. package/src/views/user/wf/wf_manage/list2.vue +875 -0
  244. package/src/views/user/wf/wf_manage/wfContentDialog.vue +23 -1
  245. package/src/views/user/wf/wf_obj_config/dialog.vue +1 -1
  246. package/src/views/user/wf/wf_obj_config/list.vue +1 -1
  247. package/src/views/user/wf/wf_obj_config/list_form.vue +1 -1
  248. package/src/views/user/wf/wf_transfer_setting/list.vue +1 -1
  249. package/src/views/user/workbench_menu/list.vue +1 -1
@@ -4,239 +4,239 @@ import QRcode from "qrcode";
4
4
 
5
5
  function getUrlParams(url) {
6
6
  let result = {};
7
- if (url) {
8
- let urlStr = url.split("?")[1];
9
- const urlSearchParams = new URLSearchParams(urlStr);
10
- result = Object.fromEntries(urlSearchParams.entries());
11
- }
12
- return result;
13
- }
14
-
15
- export default {
16
- name: "Login",
17
- props: {
18
- lang: [String, Function],
19
- },
20
- components: {},
21
- data() {
22
- return {
23
- isCounting: false,
24
- countdown: 0,
25
- buttonText: this.$t1("获取验证码"),
26
- smsTimer: null,
27
- isRememberPassword: false,
28
- loginForm: {
29
- username: "",
30
- password: "",
31
- },
32
- loginRules: {
33
- username: [
34
- {
35
- required: true,
36
- trigger: "blur",
37
- },
38
- ],
39
- password: [
40
- {
41
- required: true,
42
- trigger: "blur",
43
- },
44
- ],
45
- },
46
- passwordType: "password",
47
- capsTooltip: false,
48
- loading: false,
49
- showDialog: false,
50
- redirect: undefined,
51
- otherQuery: {},
52
- // isChangeBackground: false,
53
- backgroundClass: "",
54
- hasLogin: false,
55
- showView: false,
56
- loginForm2: {
57
- username: null,
58
- smsCode: null,
59
- },
60
- activeName: "first",
61
- searchParam: {},
62
- showContent: true,
63
-
64
- qrTimer1: null,
65
- qrTimer2: null,
66
- qrContent: null,
67
- qrCodeFlag: 0,
68
- qrBase64: "",
69
- settingConfig: settingConfig,
70
- qrExpired: false,
71
- loginConfig: {},
72
- imageUrl: "",
73
- loginMethod: "",
74
-
75
- accountLoagin: true,
76
- phoneLogin: false,
77
- qrLogin: false,
78
- };
79
- },
80
- watch: {
81
- $route: {
82
- handler: function (route) {
83
- const query = route.query;
84
- if (query) {
85
- this.redirect = query.redirect;
86
- this.otherQuery = this.getOtherQuery(query);
87
- }
88
- },
89
- immediate: true,
90
- },
91
- },
7
+ if (url) {
8
+ let urlStr = url.split("?")[1];
9
+ const urlSearchParams = new URLSearchParams(urlStr);
10
+ result = Object.fromEntries(urlSearchParams.entries());
11
+ }
12
+ return result;
13
+ }
14
+
15
+ export default {
16
+ name: "Login",
17
+ props: {
18
+ lang: [String, Function],
19
+ },
20
+ components: {},
21
+ data() {
22
+ return {
23
+ isCounting: false,
24
+ countdown: 0,
25
+ buttonText: this.$t1("获取验证码"),
26
+ smsTimer: null,
27
+ isRememberPassword: false,
28
+ loginForm: {
29
+ username: "",
30
+ password: "",
31
+ },
32
+ loginRules: {
33
+ username: [
34
+ {
35
+ required: true,
36
+ trigger: "blur",
37
+ },
38
+ ],
39
+ password: [
40
+ {
41
+ required: true,
42
+ trigger: "blur",
43
+ },
44
+ ],
45
+ },
46
+ passwordType: "password",
47
+ capsTooltip: false,
48
+ loading: false,
49
+ showDialog: false,
50
+ redirect: undefined,
51
+ otherQuery: {},
52
+ // isChangeBackground: false,
53
+ backgroundClass: "",
54
+ hasLogin: false,
55
+ showView: false,
56
+ loginForm2: {
57
+ username: null,
58
+ smsCode: null,
59
+ },
60
+ activeName: "first",
61
+ searchParam: {},
62
+ showContent: true,
63
+
64
+ qrTimer1: null,
65
+ qrTimer2: null,
66
+ qrContent: null,
67
+ qrCodeFlag: 0,
68
+ qrBase64: "",
69
+ settingConfig: settingConfig,
70
+ qrExpired: false,
71
+ loginConfig: {},
72
+ imageUrl: "",
73
+ loginMethod: "",
74
+
75
+ accountLoagin: true,
76
+ phoneLogin: false,
77
+ qrLogin: false,
78
+ };
79
+ },
80
+ watch: {
81
+ $route: {
82
+ handler: function (route) {
83
+ const query = route.query;
84
+ if (query) {
85
+ this.redirect = query.redirect;
86
+ this.otherQuery = this.getOtherQuery(query);
87
+ }
88
+ },
89
+ immediate: true,
90
+ },
91
+ },
92
92
  beforeDestroy() {
93
93
  this.clearQrLoginTimer();
94
94
  this.clearSmsTimer();
95
95
  },
96
96
  created() {
97
97
  this.init();
98
- },
99
- mounted() {
100
- // if (this.loginForm.username === '') {
101
- // this.$refs.username.focus();
102
- // } else if (this.loginForm.password === '') {
103
- // this.$refs.password.focus();
104
- // }
105
- },
106
- destroyed() {
107
- // window.removeEventListener('storage', this.afterQRScan)
108
- window.removeEventListener("keydown", this.keyDown, false);
109
- },
110
- methods: {
111
- handleLoginConfig() {
112
- let loginConfig = this.$store.getters.loginConfig || {};
113
- this.loginConfig = loginConfig;
114
- this.initImage();
115
- this.initLoginMethod();
116
- },
117
- initImage() {
118
- //初始化登录图片
119
- let loginConfig = this.loginConfig;
120
- if (loginConfig?.attachments?.length) {
121
- this.imageUrl =
122
- loginConfig.attachments[0].domain + loginConfig.attachments[0].source;
123
- }
124
- },
125
-
126
- initLoginMethod() {
127
- let loginConfig = this.loginConfig?.login_method;
128
- if (loginConfig?.length) {
129
- this.accountLoagin = loginConfig.includes(1);
130
- this.phoneLogin = loginConfig.includes(2);
131
- this.qrLogin = loginConfig.includes(3);
132
- if (this.accountLoagin) {
133
- this.activeName = "first";
134
- } else if (this.phoneLogin) {
135
- this.activeName = "second";
136
- } else if (this.qrLogin) {
137
- this.activeName = "third";
138
- this.$nextTick(() => {
139
- this.initQR();
140
- });
141
- }
142
- } else {
143
- this.accountLoagin = true;
144
- this.phoneLogin = settingConfig.mobileLoginEnabled;
145
- this.qrLogin = settingConfig.qrLoginEnabled;
146
- }
147
- },
148
- initLang() {
149
- let lang = this.$route.query.lang;
150
- if (!lang && !!this.lang) {
151
- if (typeof this.lang === "function") {
152
- lang = this.lang();
153
- } else {
154
- lang = this.lang;
155
- }
156
- }
157
- if (lang) {
158
- this.$i18n.locale = lang;
159
- localStorage.setItem("i18n-lang", lang);
160
- }
161
- },
162
- init() {
163
- this.initLang();
164
- this.handleLoginConfig();
165
- let searchParam = getUrlParams(location.search);
166
- this.searchParam = searchParam;
167
- //小熊SSO返回判断--目前因为小熊单点返回ticket有问题要特殊处理
168
- let ssoParams = {};
169
- if (location.search) {
170
- ssoParams = searchParam;
171
- }
172
- // 获取URL参数
173
- const urlParams = this.$route.query;
174
- if (
175
- ssoParams.ticket ||
176
- "bear_portalsso" == urlParams.access ||
177
- urlParams.ticket
178
- ) {
179
- //小熊单点登录
180
- this.bearSsoLogin();
181
- } else if (searchParam.gatewayToken) {
182
- this.showContent = false;
183
- this.handleGatewayTokenLogin();
184
- } else if (searchParam.xtoken) {
185
- this.showContent = false;
186
- this.handleXTokenLogin();
187
- } else {
188
- //正常登陆
189
- this.login();
190
- }
191
- },
192
- keyDown(e) {
193
- //如果是回车则执行登录方法
194
- if (e.keyCode == 13 && e.target.nodeName != "INPUT") {
195
- let closeBtn = document.querySelector(".el-dialog__close");
196
- closeBtn && closeBtn.click();
197
- if (this.activeName == "third") return;
198
- this.handleLogin();
199
- }
200
- },
201
- checkCapslock(e) {
202
- const { key } = e;
203
- this.capsTooltip = key && key.length === 1 && key >= "A" && key <= "Z";
204
- },
205
- showPwd() {
206
- if (this.passwordType === "password") {
207
- this.passwordType = "";
208
- } else {
209
- this.passwordType = "password";
210
- }
211
- this.$nextTick(() => {
212
- this.$refs.password.focus();
213
- });
214
- },
215
- handleLogin() {
216
- let loadingObj = null;
217
- let reqData = {};
218
- if (this.activeName == "first") {
219
- //账号密码登录
220
- loadingObj = this.$baseLoading();
221
- let password = encode(this.loginForm.password + "");
222
- reqData = { username: this.loginForm.username, password: password };
223
- } else {
224
- //手机验证码登录
225
- let username = this.loginForm2.username;
226
- let smsCode = this.loginForm2.smsCode;
227
- if (!username || !smsCode) {
228
- this.$baseAlert(this.$t1("请输入手机号和验证码"));
229
- return;
230
- }
231
- loadingObj = this.$baseLoading();
232
- reqData = { username: username, smsCode: smsCode, mode: "sms" };
233
- }
234
-
98
+ },
99
+ mounted() {
100
+ // if (this.loginForm.username === '') {
101
+ // this.$refs.username.focus();
102
+ // } else if (this.loginForm.password === '') {
103
+ // this.$refs.password.focus();
104
+ // }
105
+ },
106
+ destroyed() {
107
+ // window.removeEventListener('storage', this.afterQRScan)
108
+ window.removeEventListener("keydown", this.keyDown, false);
109
+ },
110
+ methods: {
111
+ handleLoginConfig() {
112
+ let loginConfig = this.$store.getters.loginConfig || {};
113
+ this.loginConfig = loginConfig;
114
+ this.initImage();
115
+ this.initLoginMethod();
116
+ },
117
+ initImage() {
118
+ //初始化登录图片
119
+ let loginConfig = this.loginConfig;
120
+ if (loginConfig?.attachments?.length) {
121
+ this.imageUrl =
122
+ loginConfig.attachments[0].domain + loginConfig.attachments[0].source;
123
+ }
124
+ },
125
+
126
+ initLoginMethod() {
127
+ let loginConfig = this.loginConfig?.login_method;
128
+ if (loginConfig?.length) {
129
+ this.accountLoagin = loginConfig.includes(1);
130
+ this.phoneLogin = loginConfig.includes(2);
131
+ this.qrLogin = loginConfig.includes(3);
132
+ if (this.accountLoagin) {
133
+ this.activeName = "first";
134
+ } else if (this.phoneLogin) {
135
+ this.activeName = "second";
136
+ } else if (this.qrLogin) {
137
+ this.activeName = "third";
138
+ this.$nextTick(() => {
139
+ this.initQR();
140
+ });
141
+ }
142
+ } else {
143
+ this.accountLoagin = true;
144
+ this.phoneLogin = settingConfig.mobileLoginEnabled;
145
+ this.qrLogin = settingConfig.qrLoginEnabled;
146
+ }
147
+ },
148
+ initLang() {
149
+ let lang = this.$route.query.lang;
150
+ if (!lang && !!this.lang) {
151
+ if (typeof this.lang === "function") {
152
+ lang = this.lang();
153
+ } else {
154
+ lang = this.lang;
155
+ }
156
+ }
157
+ if (lang) {
158
+ this.$i18n.locale = lang;
159
+ localStorage.setItem("i18n-lang", lang);
160
+ }
161
+ },
162
+ init() {
163
+ this.initLang();
164
+ this.handleLoginConfig();
165
+ let searchParam = getUrlParams(location.search);
166
+ this.searchParam = searchParam;
167
+ //小熊SSO返回判断--目前因为小熊单点返回ticket有问题要特殊处理
168
+ let ssoParams = {};
169
+ if (location.search) {
170
+ ssoParams = searchParam;
171
+ }
172
+ // 获取URL参数
173
+ const urlParams = this.$route.query;
174
+ if (
175
+ ssoParams.ticket ||
176
+ "bear_portalsso" == urlParams.access ||
177
+ urlParams.ticket
178
+ ) {
179
+ //小熊单点登录
180
+ this.bearSsoLogin();
181
+ } else if (searchParam.gatewayToken) {
182
+ this.showContent = false;
183
+ this.handleGatewayTokenLogin();
184
+ } else if (searchParam.xtoken) {
185
+ this.showContent = false;
186
+ this.handleXTokenLogin();
187
+ } else {
188
+ //正常登陆
189
+ this.login();
190
+ }
191
+ },
192
+ keyDown(e) {
193
+ //如果是回车则执行登录方法
194
+ if (e.keyCode == 13 && e.target.nodeName != "INPUT") {
195
+ let closeBtn = document.querySelector(".el-dialog__close");
196
+ closeBtn && closeBtn.click();
197
+ if (this.activeName == "third") return;
198
+ this.handleLogin();
199
+ }
200
+ },
201
+ checkCapslock(e) {
202
+ const { key } = e;
203
+ this.capsTooltip = key && key.length === 1 && key >= "A" && key <= "Z";
204
+ },
205
+ showPwd() {
206
+ if (this.passwordType === "password") {
207
+ this.passwordType = "";
208
+ } else {
209
+ this.passwordType = "password";
210
+ }
211
+ this.$nextTick(() => {
212
+ this.$refs.password.focus();
213
+ });
214
+ },
215
+ handleLogin() {
216
+ let loadingObj = null;
217
+ let reqData = {};
218
+ if (this.activeName == "first") {
219
+ //账号密码登录
220
+ loadingObj = this.$baseLoading();
221
+ let password = encode(this.loginForm.password + "");
222
+ reqData = { username: this.loginForm.username, password: password };
223
+ } else {
224
+ //手机验证码登录
225
+ let username = this.loginForm2.username;
226
+ let smsCode = this.loginForm2.smsCode;
227
+ if (!username || !smsCode) {
228
+ this.$baseAlert(this.$t1("请输入手机号和验证码"));
229
+ return;
230
+ }
231
+ loadingObj = this.$baseLoading();
232
+ reqData = { username: username, smsCode: smsCode, mode: "sms" };
233
+ }
234
+
235
235
  if (settingConfig.i18nEnabled) {
236
- //登录传语种到后台
237
- let language = this.$i18n?.locale;
238
- if (language && language != "zh") {
239
- reqData.language = language;
236
+ //登录传语种到后台
237
+ let language = this.$i18n?.locale;
238
+ if (language && language != "zh") {
239
+ reqData.language = language;
240
240
  }
241
241
  }
242
242
 
@@ -257,219 +257,210 @@ export default {
257
257
  this.handleRedirectUrl();
258
258
  } else {
259
259
  setTimeout(function () {
260
- loadingObj.close();
261
- }, 200);
262
- }
263
- })
264
- .catch((e) => {
265
- this.loading = false;
266
- setTimeout(function () {
267
- loadingObj.close();
268
- }, 200);
269
- console.error(e);
270
- });
271
- },
272
- getOtherQuery(query) {
273
- return Object.keys(query).reduce((acc, cur) => {
274
- if (cur !== "redirect") {
275
- acc[cur] = query[cur];
276
- }
277
- return acc;
278
- }, {});
279
- },
280
- initPassword() {
281
- var u = localStorage.getItem("login_info");
282
- var login_info;
283
- if (u) {
284
- login_info = JSON.parse(u);
285
- var username = login_info.username;
286
- var password = login_info.password;
287
- var isRememberPassword = login_info.isRememberPassword;
288
- if (isRememberPassword == "true") {
289
- this.isRememberPassword = true;
290
- this.loginForm.username = username;
291
- this.loginForm.password = password;
292
- }
293
- }
294
- },
295
- rememberPassword() {
296
- if (this.isRememberPassword) {
297
- var username = this.loginForm.username;
298
- var password = this.loginForm.password;
299
- var login_info = {
300
- username: username,
301
- password: password,
302
- isRememberPassword: "true",
303
- };
304
- localStorage.setItem("login_info", JSON.stringify(login_info));
305
- } else {
306
- localStorage.removeItem("login_info");
307
- }
308
- },
309
- changeBackground() {
310
- if (
311
- location.host.indexOf("pcp.sc.5mall.com") >= 0 ||
312
- location.host.indexOf("pip.bears.com.cn") >= 0
313
- ) {
314
- this.backgroundClass = "pcp";
315
- } else if (location.host.indexOf("chigo.sc.5mall.com") >= 0) {
316
- this.backgroundClass = "chigo";
317
- } else {
318
- this.backgroundClass = "tc";
319
- }
320
- },
321
- login() {
322
- let url = window.MAIN_WEB_PREFIX + "/index.html/#/login";
323
- if (
324
- self != top &&
325
- (process.env.NODE_ENV == "development" || self.host == parent.host)
326
- ) {
327
- parent.location.href = url;
328
- } else if (
329
- process.env.NODE_ENV !== "development" &&
330
- window.MAIN_WEB_PREFIX &&
331
- window.MAIN_WEB_PREFIX != window.WEB_PREFIX
332
- ) {
333
- window.location.href = url;
334
- }
335
- /* let lang = this.$route.query.lang;
336
- if(lang=="en-US"){
337
- changeLocale(lang);
338
- }else{
339
- changeLocale("zh-CN");
340
- } */
341
- // window.addEventListener('storage', this.afterQRScan)
342
-
343
- window.removeEventListener("keydown", this.keyDown, false);
344
- window.addEventListener("keydown", this.keyDown, false);
345
- this.changeBackground();
346
- this.initPassword();
347
- this.showView = true;
348
- },
349
- bearSsoLogin() {
350
- //小熊SSO返回判断--目前因为小熊单点返回ticket有问题要特殊处理
351
- let urlParams = {};
352
- if (location.search) {
353
- urlParams = getUrlParams(location.search);
354
- }
355
- //let urlParams = this.$route.query;
356
-
357
- // 获取URL参数
358
- console.log("urlParams", urlParams);
359
- const loginPath = process.env.VUE_APP_BASE_API;
360
- console.log("loginPath--->", loginPath);
361
-
362
- //&& loginPath ===window.location.href
363
- if (urlParams.ticket) {
364
- console.log("进入回调方法=================");
365
- this.$store.dispatch("user/clearToken");
366
- this.$http({
367
- url: USER_PREFIX + "/auth/idmLogin",
368
- method: `post`,
369
- data: { ticket: urlParams.ticket },
370
- isLoading: true,
371
- modalStrictly: true,
372
- success: (res) => {
373
- let token = res.objx;
374
- console.log("token", token);
375
- this.$store.dispatch("user/addToken", { token }).then((res) => {
376
- localStorage.removeItem("currentMenuId");
377
- this.rememberPassword();
378
- /*this.$router.push({
379
- path: '/'
380
- });*/
381
- this.loading = false;
382
- window.removeEventListener("keydown", this.keyDown, false);
383
- let redirect = sessionStorage.getItem("loginRedirect");
384
- this.handleRedirectUrl(redirect);
385
- });
386
- },
387
- fail: () => {
388
- this.showView = true;
389
- },
390
- error: () => {
391
- this.showView = true;
392
- },
393
- });
394
- } else {
395
- console.log("进入单点方法");
396
- let redirect = this.$route.query.redirect || "";
397
- this.$http({
398
- url: USER_PREFIX + "/auth/idmLoginUrl",
399
- method: `post`,
400
- data: {},
401
- isLoading: true,
402
- modalStrictly: true,
403
- success: (res) => {
404
- sessionStorage.setItem("loginRedirect", redirect);
405
- location.href = res.objx;
406
- // location.href = res.objx+"&redirect="+redirect;
407
- },
408
- fail: () => {
409
- this.showView = true;
410
- },
411
- error: () => {
412
- this.showView = true;
413
- },
414
- });
415
- }
416
- },
417
- sendCode() {
418
- if (this.isCounting) {
419
- return;
420
- }
421
- let mobile = this.loginForm2.username;
422
- if (!mobile) {
423
- this.$baseAlert("请输入手机号");
424
- return;
425
- }
426
-
427
- this.$http({
428
- url: USER_PREFIX + "/auth/sendSmsCode",
429
- method: `post`,
430
- data: { mobile: mobile },
431
- isLoading: true,
432
- success: (res) => {
433
- this.$message({
434
- message: res.content,
435
- type: "success",
436
- duration: 1500,
437
- });
438
- this.isCounting = true;
439
- this.countdown = 60;
440
- this.buttonText = this.$t1("60秒后重新获取");
441
- this.clearSmsTimer();
442
- this.smsTimer = setInterval(() => {
443
- this.countdown--;
444
- this.buttonText = this.$t1("{time}秒后重新获取", {
445
- time: this.countdown,
446
- });
447
- if (this.countdown == 0) {
448
- this.clearSmsTimer();
449
- this.isCounting = false;
450
- this.buttonText = this.$t1("获取验证码");
451
- }
452
- }, 1000);
453
- },
454
- });
455
- },
456
- clearSmsTimer() {
457
- if (this.smsTimer) {
458
- clearInterval(this.smsTimer);
459
- this.smsTimer = null;
460
- }
260
+ loadingObj.close();
261
+ }, 200);
262
+ }
263
+ })
264
+ .catch((e) => {
265
+ this.loading = false;
266
+ setTimeout(function () {
267
+ loadingObj.close();
268
+ }, 200);
269
+ console.error(e);
270
+ });
271
+ },
272
+ getOtherQuery(query) {
273
+ return Object.keys(query).reduce((acc, cur) => {
274
+ if (cur !== "redirect") {
275
+ acc[cur] = query[cur];
276
+ }
277
+ return acc;
278
+ }, {});
279
+ },
280
+ initPassword() {
281
+ var u = localStorage.getItem("login_info");
282
+ var login_info;
283
+ if (u) {
284
+ login_info = JSON.parse(u);
285
+ var username = login_info.username;
286
+ var password = login_info.password;
287
+ var isRememberPassword = login_info.isRememberPassword;
288
+ if (isRememberPassword == "true") {
289
+ this.isRememberPassword = true;
290
+ this.loginForm.username = username;
291
+ this.loginForm.password = password;
292
+ }
293
+ }
294
+ },
295
+ rememberPassword() {
296
+ if (this.isRememberPassword) {
297
+ var username = this.loginForm.username;
298
+ var password = this.loginForm.password;
299
+ var login_info = {
300
+ username: username,
301
+ password: password,
302
+ isRememberPassword: "true",
303
+ };
304
+ localStorage.setItem("login_info", JSON.stringify(login_info));
305
+ } else {
306
+ localStorage.removeItem("login_info");
307
+ }
308
+ },
309
+ changeBackground() {
310
+ this.backgroundClass = "tc";
311
+ },
312
+ login() {
313
+ let url = window.MAIN_WEB_PREFIX + "/index.html/#/login";
314
+ if (
315
+ self != top &&
316
+ (process.env.NODE_ENV == "development" || self.host == parent.host)
317
+ ) {
318
+ parent.location.href = url;
319
+ } else if (
320
+ process.env.NODE_ENV !== "development" &&
321
+ window.MAIN_WEB_PREFIX &&
322
+ window.MAIN_WEB_PREFIX != window.WEB_PREFIX
323
+ ) {
324
+ window.location.href = url;
325
+ }
326
+ /* let lang = this.$route.query.lang;
327
+ if(lang=="en-US"){
328
+ changeLocale(lang);
329
+ }else{
330
+ changeLocale("zh-CN");
331
+ } */
332
+ // window.addEventListener('storage', this.afterQRScan)
333
+
334
+ window.removeEventListener("keydown", this.keyDown, false);
335
+ window.addEventListener("keydown", this.keyDown, false);
336
+ this.changeBackground();
337
+ this.initPassword();
338
+ this.showView = true;
339
+ },
340
+ bearSsoLogin() {
341
+ //小熊SSO返回判断--目前因为小熊单点返回ticket有问题要特殊处理
342
+ let urlParams = {};
343
+ if (location.search) {
344
+ urlParams = getUrlParams(location.search);
345
+ }
346
+ //let urlParams = this.$route.query;
347
+
348
+ // 获取URL参数
349
+ console.log("urlParams", urlParams);
350
+ const loginPath = process.env.VUE_APP_BASE_API;
351
+ console.log("loginPath--->", loginPath);
352
+
353
+ //&& loginPath ===window.location.href
354
+ if (urlParams.ticket) {
355
+ console.log("进入回调方法=================");
356
+ this.$store.dispatch("user/clearToken");
357
+ this.$http({
358
+ url: USER_PREFIX + "/auth/idmLogin",
359
+ method: `post`,
360
+ data: { ticket: urlParams.ticket },
361
+ isLoading: true,
362
+ modalStrictly: true,
363
+ success: (res) => {
364
+ let token = res.objx;
365
+ console.log("token", token);
366
+ this.$store.dispatch("user/addToken", { token }).then((res) => {
367
+ localStorage.removeItem("currentMenuId");
368
+ this.rememberPassword();
369
+ /*this.$router.push({
370
+ path: '/'
371
+ });*/
372
+ this.loading = false;
373
+ window.removeEventListener("keydown", this.keyDown, false);
374
+ let redirect = sessionStorage.getItem("loginRedirect");
375
+ this.handleRedirectUrl(redirect);
376
+ });
377
+ },
378
+ fail: () => {
379
+ this.showView = true;
380
+ },
381
+ error: () => {
382
+ this.showView = true;
383
+ },
384
+ });
385
+ } else {
386
+ console.log("进入单点方法");
387
+ let redirect = this.$route.query.redirect || "";
388
+ this.$http({
389
+ url: USER_PREFIX + "/auth/idmLoginUrl",
390
+ method: `post`,
391
+ data: {},
392
+ isLoading: true,
393
+ modalStrictly: true,
394
+ success: (res) => {
395
+ sessionStorage.setItem("loginRedirect", redirect);
396
+ location.href = res.objx;
397
+ // location.href = res.objx+"&redirect="+redirect;
398
+ },
399
+ fail: () => {
400
+ this.showView = true;
401
+ },
402
+ error: () => {
403
+ this.showView = true;
404
+ },
405
+ });
406
+ }
407
+ },
408
+ sendCode() {
409
+ if (this.isCounting) {
410
+ return;
411
+ }
412
+ let mobile = this.loginForm2.username;
413
+ if (!mobile) {
414
+ this.$baseAlert("请输入手机号");
415
+ return;
416
+ }
417
+
418
+ this.$http({
419
+ url: USER_PREFIX + "/auth/sendSmsCode",
420
+ method: `post`,
421
+ data: { mobile: mobile },
422
+ isLoading: true,
423
+ success: (res) => {
424
+ this.$message({
425
+ message: res.content,
426
+ type: "success",
427
+ duration: 1500,
428
+ });
429
+ this.isCounting = true;
430
+ this.countdown = 60;
431
+ this.buttonText = this.$t1("60秒后重新获取");
432
+ this.clearSmsTimer();
433
+ this.smsTimer = setInterval(() => {
434
+ this.countdown--;
435
+ this.buttonText = this.$t1("{time}秒后重新获取", {
436
+ time: this.countdown,
437
+ });
438
+ if (this.countdown == 0) {
439
+ this.clearSmsTimer();
440
+ this.isCounting = false;
441
+ this.buttonText = this.$t1("获取验证码");
442
+ }
443
+ }, 1000);
444
+ },
445
+ });
446
+ },
447
+ clearSmsTimer() {
448
+ if (this.smsTimer) {
449
+ clearInterval(this.smsTimer);
450
+ this.smsTimer = null;
451
+ }
461
452
  },
462
453
  mobileLogin() {},
463
454
  handleRedirectUrl(redirect) {
464
455
  redirect = redirect || this.$route.query.redirect;
465
456
  let path = null;
466
457
  if (redirect && redirect.startsWith("/outLinkView")) {
467
- path = this.addParamToUrl(redirect, "hasToken", "true");
468
- } else {
469
- path = "/";
470
- }
471
- this.getWebPrefix((webPrefix) => {
472
- let prefix = webPrefix ? "/" + webPrefix : "";
458
+ path = this.addParamToUrl(redirect, "hasToken", "true");
459
+ } else {
460
+ path = "/";
461
+ }
462
+ this.getWebPrefix((webPrefix) => {
463
+ let prefix = webPrefix ? "/" + webPrefix : "";
473
464
  let ssotoken = this.searchParam.gatewayToken;
474
465
  let xtoken = this.searchParam.xtoken;
475
466
  if (prefix && prefix !== window.WEB_PREFIX) {
@@ -485,22 +476,22 @@ export default {
485
476
  });
486
477
  /*if (redirect && redirect.startsWith("/outLinkView")) {
487
478
  let path = this.addParamToUrl(redirect, "hasToken", "true");
488
- this.$router.push({
489
- path: path
490
- });
491
- } else {
492
- this.$router.push({
493
- path: '/'
494
- });
495
- }*/
496
- },
497
- addParamToUrl(url, paramKey, paramValue) {
498
- var regex = new RegExp("([?&])" + paramKey + "=.*?(&|$)", "i");
499
- if (url.match(regex)) {
500
- url = url.replace(regex, "$1" + paramKey + "=" + paramValue + "$2");
501
- } else {
502
- url +=
503
- (url.indexOf("?") === -1 ? "?" : "&") + paramKey + "=" + paramValue;
479
+ this.$router.push({
480
+ path: path
481
+ });
482
+ } else {
483
+ this.$router.push({
484
+ path: '/'
485
+ });
486
+ }*/
487
+ },
488
+ addParamToUrl(url, paramKey, paramValue) {
489
+ var regex = new RegExp("([?&])" + paramKey + "=.*?(&|$)", "i");
490
+ if (url.match(regex)) {
491
+ url = url.replace(regex, "$1" + paramKey + "=" + paramValue + "$2");
492
+ } else {
493
+ url +=
494
+ (url.indexOf("?") === -1 ? "?" : "&") + paramKey + "=" + paramValue;
504
495
  }
505
496
  return url;
506
497
  },
@@ -508,9 +499,9 @@ export default {
508
499
  this.$http({
509
500
  url: USER_PREFIX + "/auth/getWebPrefix",
510
501
  method: `post`,
511
- data: {},
512
- isLoading: true,
513
- success: (res) => {
502
+ data: {},
503
+ isLoading: true,
504
+ success: (res) => {
514
505
  let webPrefix = res.objx;
515
506
  callback && callback(webPrefix);
516
507
  },
@@ -518,47 +509,47 @@ export default {
518
509
  },
519
510
  handleGatewayTokenLogin() {
520
511
  let ssotoken = this.searchParam.gatewayToken;
521
- let companycode = this.searchParam.entCode;
522
- this.$store
523
- .dispatch("user/login2", { ssotoken, companycode })
524
- .then((res) => {
525
- if (res.type == "success") {
526
- this.$nextTick(() => {
527
- this.handleRedirectUrl();
528
- });
529
- }
530
- });
531
- },
532
- handleXTokenLogin() {
533
- let xtoken = this.searchParam.xtoken;
534
- let companycode = this.searchParam.entCode;
535
- this.$store
536
- .dispatch("user/login2", { xtoken, companycode })
537
- .then((res) => {
538
- if (res.type == "success") {
539
- this.handleRedirectUrl();
540
- }
541
- });
542
- },
543
- /**二维码登录begin*/
544
- guid() {
545
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
546
- /[xy]/g,
547
- function (t) {
548
- var e = (16 * Math.random()) | 0;
549
- return ("x" == t ? e : (3 & e) | 8).toString(16);
550
- }
551
- );
552
- },
553
- initQR() {
554
- this.clearQrLoginTimer();
555
- this.qrExpired = true;
556
- let option = { width: 300, height: 300 };
557
- this.qrContent = this.guid();
558
- this.createQR(this.qrContent, option).then((url) => {
559
- this.qrExpired = false;
560
- this.qrBase64 = url;
561
- this.createQrLoginTimer();
512
+ let companycode = this.searchParam.entCode;
513
+ this.$store
514
+ .dispatch("user/login2", { ssotoken, companycode })
515
+ .then((res) => {
516
+ if (res.type == "success") {
517
+ this.$nextTick(() => {
518
+ this.handleRedirectUrl();
519
+ });
520
+ }
521
+ });
522
+ },
523
+ handleXTokenLogin() {
524
+ let xtoken = this.searchParam.xtoken;
525
+ let companycode = this.searchParam.entCode;
526
+ this.$store
527
+ .dispatch("user/login2", { xtoken, companycode })
528
+ .then((res) => {
529
+ if (res.type == "success") {
530
+ this.handleRedirectUrl();
531
+ }
532
+ });
533
+ },
534
+ /**二维码登录begin*/
535
+ guid() {
536
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
537
+ /[xy]/g,
538
+ function (t) {
539
+ var e = (16 * Math.random()) | 0;
540
+ return ("x" == t ? e : (3 & e) | 8).toString(16);
541
+ }
542
+ );
543
+ },
544
+ initQR() {
545
+ this.clearQrLoginTimer();
546
+ this.qrExpired = true;
547
+ let option = { width: 300, height: 300 };
548
+ this.qrContent = this.guid();
549
+ this.createQR(this.qrContent, option).then((url) => {
550
+ this.qrExpired = false;
551
+ this.qrBase64 = url;
552
+ this.createQrLoginTimer();
562
553
  });
563
554
  },
564
555
  // 生成二维码
@@ -571,66 +562,66 @@ export default {
571
562
  },
572
563
  changeTab() {
573
564
  // this.initQR();
574
- // return
575
- if (this.activeName == "third") {
576
- this.initQR();
577
- } else {
578
- this.clearQrLoginTimer();
579
- }
580
- },
581
- clearQrLoginTimer() {
582
- if (this.qrTimer1) {
583
- clearTimeout(this.qrTimer1);
584
- this.qrTimer1 = null;
585
- }
586
- if (this.qrTimer2) {
587
- clearTimeout(this.qrTimer2);
588
- this.qrTimer2 = null;
589
- }
590
- },
591
- createQrLoginTimer() {
592
- this.checkQrLoginTimerHanlde();
593
- this.qrTimer2 = setTimeout(() => {
594
- this.qrExpired = true;
595
- this.clearQrLoginTimer();
596
- }, 60000);
597
- },
598
- checkQrLoginTimerHanlde() {
599
- this.qrTimer1 = setTimeout(() => {
600
- this.checkQrLoginStatusHanlde();
601
- }, 3000);
602
- },
603
- checkQrLoginStatusHanlde() {
604
- if (this.qrExpired) {
605
- return;
606
- }
607
- this.$http({
608
- url: USER_PREFIX + "/auth/login",
609
- method: `post`,
610
- data: { as: this.qrContent },
611
- // isLoading: true,
612
- failMsg: false,
613
- success: (res) => {
614
- let token = res.objx;
615
- if (token) {
616
- this.$message({
617
- message: this.$t1("登录成功"),
618
- type: "success",
619
- });
620
- this.clearQrLoginTimer();
621
- this.$store.dispatch("user/addToken", { token }).then((res) => {
622
- localStorage.removeItem("currentMenuId");
623
- this.rememberPassword();
624
- this.loading = false;
625
- window.removeEventListener("keydown", this.keyDown, false);
626
- this.handleRedirectUrl();
627
- });
628
- } else {
629
- this.checkQrLoginTimerHanlde();
630
- }
631
- },
632
- });
633
- },
634
- /**二维码登录end*/
635
- },
636
- };
565
+ // return
566
+ if (this.activeName == "third") {
567
+ this.initQR();
568
+ } else {
569
+ this.clearQrLoginTimer();
570
+ }
571
+ },
572
+ clearQrLoginTimer() {
573
+ if (this.qrTimer1) {
574
+ clearTimeout(this.qrTimer1);
575
+ this.qrTimer1 = null;
576
+ }
577
+ if (this.qrTimer2) {
578
+ clearTimeout(this.qrTimer2);
579
+ this.qrTimer2 = null;
580
+ }
581
+ },
582
+ createQrLoginTimer() {
583
+ this.checkQrLoginTimerHanlde();
584
+ this.qrTimer2 = setTimeout(() => {
585
+ this.qrExpired = true;
586
+ this.clearQrLoginTimer();
587
+ }, 60000);
588
+ },
589
+ checkQrLoginTimerHanlde() {
590
+ this.qrTimer1 = setTimeout(() => {
591
+ this.checkQrLoginStatusHanlde();
592
+ }, 3000);
593
+ },
594
+ checkQrLoginStatusHanlde() {
595
+ if (this.qrExpired) {
596
+ return;
597
+ }
598
+ this.$http({
599
+ url: USER_PREFIX + "/auth/login",
600
+ method: `post`,
601
+ data: { as: this.qrContent },
602
+ // isLoading: true,
603
+ failMsg: false,
604
+ success: (res) => {
605
+ let token = res.objx;
606
+ if (token) {
607
+ this.$message({
608
+ message: this.$t1("登录成功"),
609
+ type: "success",
610
+ });
611
+ this.clearQrLoginTimer();
612
+ this.$store.dispatch("user/addToken", { token }).then((res) => {
613
+ localStorage.removeItem("currentMenuId");
614
+ this.rememberPassword();
615
+ this.loading = false;
616
+ window.removeEventListener("keydown", this.keyDown, false);
617
+ this.handleRedirectUrl();
618
+ });
619
+ } else {
620
+ this.checkQrLoginTimerHanlde();
621
+ }
622
+ },
623
+ });
624
+ },
625
+ /**二维码登录end*/
626
+ },
627
+ };