eoss-ui 0.3.97
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/CHANGELOG.md +929 -0
- package/README.md +30 -0
- package/lib/button-group.js +2857 -0
- package/lib/button.js +2884 -0
- package/lib/card.js +603 -0
- package/lib/cascader.js +373 -0
- package/lib/checkbox-group.js +3099 -0
- package/lib/clients.js +375 -0
- package/lib/config/api.js +205 -0
- package/lib/data-table-form.js +3848 -0
- package/lib/data-table.js +6315 -0
- package/lib/date-picker.js +2821 -0
- package/lib/dialog.js +3730 -0
- package/lib/enterprise.js +372 -0
- package/lib/eoss-ui.common.js +65365 -0
- package/lib/error-page.js +293 -0
- package/lib/flow-group.js +4200 -0
- package/lib/flow-list.js +4350 -0
- package/lib/flow.js +12893 -0
- package/lib/form.js +15635 -0
- package/lib/handle-user.js +2900 -0
- package/lib/handler.js +3118 -0
- package/lib/index.js +1 -0
- package/lib/input-number.js +2743 -0
- package/lib/input.js +2935 -0
- package/lib/label.js +411 -0
- package/lib/login.js +5048 -0
- package/lib/main.js +5816 -0
- package/lib/mainComp.js +6530 -0
- package/lib/menu.js +529 -0
- package/lib/nav.js +3048 -0
- package/lib/notify.js +1079 -0
- package/lib/page.js +3036 -0
- package/lib/pagination.js +354 -0
- package/lib/player.js +2904 -0
- package/lib/qr-code.js +2860 -0
- package/lib/radio-group.js +3091 -0
- package/lib/select-ganged.js +3242 -0
- package/lib/select.js +3295 -0
- package/lib/selector-panel.js +4425 -0
- package/lib/selector.js +3722 -0
- package/lib/sizer.js +3067 -0
- package/lib/steps.js +2943 -0
- package/lib/switch.js +2784 -0
- package/lib/table-form.js +6211 -0
- package/lib/tabs-panel.js +274 -0
- package/lib/tabs.js +4988 -0
- package/lib/theme-chalk/base.css +1 -0
- package/lib/theme-chalk/button-group.css +1 -0
- package/lib/theme-chalk/button.css +0 -0
- package/lib/theme-chalk/card.css +1 -0
- package/lib/theme-chalk/cascader.css +0 -0
- package/lib/theme-chalk/checkbox-group.css +1 -0
- package/lib/theme-chalk/clients.css +1 -0
- package/lib/theme-chalk/data-table-form.css +1 -0
- package/lib/theme-chalk/data-table.css +1 -0
- package/lib/theme-chalk/date-picker.css +1 -0
- package/lib/theme-chalk/dialog.css +1 -0
- package/lib/theme-chalk/enterprise.css +1 -0
- package/lib/theme-chalk/error-page.css +1 -0
- package/lib/theme-chalk/flow-chart.css +0 -0
- package/lib/theme-chalk/flow-group.css +1 -0
- package/lib/theme-chalk/flow-list.css +1 -0
- package/lib/theme-chalk/flow.css +1 -0
- package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/form.css +1 -0
- package/lib/theme-chalk/handle-user.css +1 -0
- package/lib/theme-chalk/handler.css +1 -0
- package/lib/theme-chalk/icon.css +1 -0
- package/lib/theme-chalk/index.css +1 -0
- package/lib/theme-chalk/input-number.css +0 -0
- package/lib/theme-chalk/input.css +1 -0
- package/lib/theme-chalk/label.css +1 -0
- package/lib/theme-chalk/login.css +1 -0
- package/lib/theme-chalk/main.css +1 -0
- package/lib/theme-chalk/mainComp.css +0 -0
- package/lib/theme-chalk/menu.css +1 -0
- package/lib/theme-chalk/nav.css +1 -0
- package/lib/theme-chalk/notify.css +0 -0
- package/lib/theme-chalk/page.css +1 -0
- package/lib/theme-chalk/pagination.css +1 -0
- package/lib/theme-chalk/player.css +1 -0
- package/lib/theme-chalk/qr-code.css +1 -0
- package/lib/theme-chalk/radio-group.css +1 -0
- package/lib/theme-chalk/radio.css +1 -0
- package/lib/theme-chalk/select-ganged.css +1 -0
- package/lib/theme-chalk/select.css +0 -0
- package/lib/theme-chalk/selector-panel.css +1 -0
- package/lib/theme-chalk/selector.css +1 -0
- package/lib/theme-chalk/sizer.css +1 -0
- package/lib/theme-chalk/steps.css +1 -0
- package/lib/theme-chalk/switch.css +1 -0
- package/lib/theme-chalk/table-form.css +0 -0
- package/lib/theme-chalk/tabs-panel.css +0 -0
- package/lib/theme-chalk/tabs.css +1 -0
- package/lib/theme-chalk/tips.css +1 -0
- package/lib/theme-chalk/toolbar.css +1 -0
- package/lib/theme-chalk/tree-group.css +1 -0
- package/lib/theme-chalk/tree.css +1 -0
- package/lib/theme-chalk/upload.css +1 -0
- package/lib/theme-chalk/wujie.css +0 -0
- package/lib/theme-chalk/wxlogin.css +1 -0
- package/lib/tips.js +2830 -0
- package/lib/toolbar.js +531 -0
- package/lib/tree-group.js +3373 -0
- package/lib/tree.js +3482 -0
- package/lib/upload.js +3913 -0
- package/lib/utils/bus.js +9 -0
- package/lib/utils/date-util.js +318 -0
- package/lib/utils/http.js +58 -0
- package/lib/utils/rules.js +19 -0
- package/lib/utils/store.js +22 -0
- package/lib/utils/util.js +2056 -0
- package/lib/wujie.js +2845 -0
- package/lib/wxlogin.js +2799 -0
- package/package.json +151 -0
- package/packages/button/index.js +5 -0
- package/packages/button/src/main.vue +264 -0
- package/packages/button-group/index.js +5 -0
- package/packages/button-group/src/main.vue +130 -0
- package/packages/card/index.js +5 -0
- package/packages/card/src/main.vue +144 -0
- package/packages/cascader/index.js +5 -0
- package/packages/cascader/src/main.vue +144 -0
- package/packages/checkbox-group/index.js +5 -0
- package/packages/checkbox-group/src/main.vue +285 -0
- package/packages/clients/index.js +5 -0
- package/packages/clients/src/main.vue +50 -0
- package/packages/data-table/index.js +5 -0
- package/packages/data-table/src/children.vue +40 -0
- package/packages/data-table/src/column.vue +796 -0
- package/packages/data-table/src/main copy.vue +1383 -0
- package/packages/data-table/src/main.vue +1229 -0
- package/packages/data-table/src/mixins/table.js +12 -0
- package/packages/data-table/src/sizer.vue +160 -0
- package/packages/data-table-form/index.js +5 -0
- package/packages/data-table-form/src/colgroup.vue +17 -0
- package/packages/data-table-form/src/main.vue +167 -0
- package/packages/data-table-form/src/table.vue +192 -0
- package/packages/data-table-form/src/tbody.vue +219 -0
- package/packages/data-table-form/src/thead.vue +68 -0
- package/packages/date-picker/index.js +5 -0
- package/packages/date-picker/src/main.vue +185 -0
- package/packages/dialog/index.js +5 -0
- package/packages/dialog/src/main.vue +442 -0
- package/packages/enterprise/index.js +5 -0
- package/packages/enterprise/src/main.vue +66 -0
- package/packages/error-page/index.js +5 -0
- package/packages/error-page/src/main.vue +44 -0
- package/packages/flow/index.js +5 -0
- package/packages/flow/src/component/CommonOpinions.vue +290 -0
- package/packages/flow/src/component/CustomPreset.vue +311 -0
- package/packages/flow/src/component/FileList.vue +97 -0
- package/packages/flow/src/component/Preset.vue +253 -0
- package/packages/flow/src/component/SendMsg.vue +221 -0
- package/packages/flow/src/component/TimeLimit.vue +190 -0
- package/packages/flow/src/component/taskUnionExamine.vue +507 -0
- package/packages/flow/src/form.vue +120 -0
- package/packages/flow/src/main.vue +2107 -0
- package/packages/flow/src/processForm.vue +866 -0
- package/packages/flow/src/processReject.vue +262 -0
- package/packages/flow/src/selectUser.vue +425 -0
- package/packages/flow/src/startTaskRead.vue +556 -0
- package/packages/flow/src/table.vue +51 -0
- package/packages/flow-group/index.js +5 -0
- package/packages/flow-group/src/main.vue +540 -0
- package/packages/flow-list/index.js +5 -0
- package/packages/flow-list/src/flow-table.vue +445 -0
- package/packages/flow-list/src/main.vue +456 -0
- package/packages/form/index.js +5 -0
- package/packages/form/src/main.vue +4429 -0
- package/packages/form/src/table.vue +1196 -0
- package/packages/handle-user/index.js +5 -0
- package/packages/handle-user/src/main.vue +122 -0
- package/packages/handler/index.js +5 -0
- package/packages/handler/src/main.vue +306 -0
- package/packages/input/index.js +5 -0
- package/packages/input/src/main.vue +307 -0
- package/packages/input-number/index.js +5 -0
- package/packages/input-number/src/main.vue +106 -0
- package/packages/label/index.js +5 -0
- package/packages/label/src/main.vue +208 -0
- package/packages/login/index.js +5 -0
- package/packages/login/src/main.vue +1193 -0
- package/packages/login/src/resetPassword.vue +332 -0
- package/packages/main/index.js +5 -0
- package/packages/main/src/main.vue +1496 -0
- package/packages/main/src/message.vue +239 -0
- package/packages/main/src/notice.vue +145 -0
- package/packages/main/src/settings.vue +105 -0
- package/packages/main/src/userinfo.vue +430 -0
- package/packages/mainComp/index.js +5 -0
- package/packages/mainComp/src/async-component/index.vue +85 -0
- package/packages/mainComp/src/main.vue +1934 -0
- package/packages/mainComp/src/message.vue +239 -0
- package/packages/mainComp/src/notice.vue +152 -0
- package/packages/mainComp/src/settings.vue +105 -0
- package/packages/mainComp/src/userinfo.vue +423 -0
- package/packages/menu/index.js +5 -0
- package/packages/menu/src/main.vue +401 -0
- package/packages/nav/index.js +5 -0
- package/packages/nav/src/main.vue +250 -0
- package/packages/notify/index.js +5 -0
- package/packages/notify/src/main.vue +538 -0
- package/packages/page/index.js +5 -0
- package/packages/page/src/main.vue +167 -0
- package/packages/pagination/index.js +5 -0
- package/packages/pagination/src/main.vue +77 -0
- package/packages/player/index.js +5 -0
- package/packages/player/src/main.vue +194 -0
- package/packages/qr-code/index.js +5 -0
- package/packages/qr-code/src/main.vue +154 -0
- package/packages/radio/index.js +5 -0
- package/packages/radio/src/main.vue +259 -0
- package/packages/radio-group/index.js +6 -0
- package/packages/radio-group/src/main.vue +267 -0
- package/packages/select/index.js +5 -0
- package/packages/select/src/main.vue +683 -0
- package/packages/select-ganged/index.js +5 -0
- package/packages/select-ganged/src/main.vue +686 -0
- package/packages/selector/index.js +5 -0
- package/packages/selector/src/main.vue +588 -0
- package/packages/selector-panel/index.js +5 -0
- package/packages/selector-panel/src/main.vue +968 -0
- package/packages/selector-panel/src/selection.vue +142 -0
- package/packages/selector-panel/src/tree.vue +129 -0
- package/packages/sizer/index.js +5 -0
- package/packages/sizer/src/main.vue +254 -0
- package/packages/steps/index.js +5 -0
- package/packages/steps/src/main.vue +175 -0
- package/packages/switch/index.js +5 -0
- package/packages/switch/src/main.vue +154 -0
- package/packages/table-form/index.js +5 -0
- package/packages/tabs/index.js +5 -0
- package/packages/tabs/src/main.vue +749 -0
- package/packages/tabs-panel/index.js +5 -0
- package/packages/tabs-panel/src/main.vue +18 -0
- package/packages/theme-chalk/README.md +33 -0
- package/packages/theme-chalk/lib/base.css +1 -0
- package/packages/theme-chalk/lib/button-group.css +1 -0
- package/packages/theme-chalk/lib/button.css +0 -0
- package/packages/theme-chalk/lib/card.css +1 -0
- package/packages/theme-chalk/lib/cascader.css +0 -0
- package/packages/theme-chalk/lib/checkbox-group.css +1 -0
- package/packages/theme-chalk/lib/clients.css +1 -0
- package/packages/theme-chalk/lib/data-table-form.css +1 -0
- package/packages/theme-chalk/lib/data-table.css +1 -0
- package/packages/theme-chalk/lib/date-picker.css +1 -0
- package/packages/theme-chalk/lib/dialog.css +1 -0
- package/packages/theme-chalk/lib/enterprise.css +1 -0
- package/packages/theme-chalk/lib/error-page.css +1 -0
- package/packages/theme-chalk/lib/flow-chart.css +0 -0
- package/packages/theme-chalk/lib/flow-group.css +1 -0
- package/packages/theme-chalk/lib/flow-list.css +1 -0
- package/packages/theme-chalk/lib/flow.css +1 -0
- package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/lib/form.css +1 -0
- package/packages/theme-chalk/lib/handle-user.css +1 -0
- package/packages/theme-chalk/lib/handler.css +1 -0
- package/packages/theme-chalk/lib/icon.css +1 -0
- package/packages/theme-chalk/lib/index.css +1 -0
- package/packages/theme-chalk/lib/input-number.css +0 -0
- package/packages/theme-chalk/lib/input.css +1 -0
- package/packages/theme-chalk/lib/label.css +1 -0
- package/packages/theme-chalk/lib/login.css +1 -0
- package/packages/theme-chalk/lib/main.css +1 -0
- package/packages/theme-chalk/lib/mainComp.css +0 -0
- package/packages/theme-chalk/lib/menu.css +1 -0
- package/packages/theme-chalk/lib/nav.css +1 -0
- package/packages/theme-chalk/lib/notify.css +0 -0
- package/packages/theme-chalk/lib/page.css +1 -0
- package/packages/theme-chalk/lib/pagination.css +1 -0
- package/packages/theme-chalk/lib/player.css +1 -0
- package/packages/theme-chalk/lib/qr-code.css +1 -0
- package/packages/theme-chalk/lib/radio-group.css +1 -0
- package/packages/theme-chalk/lib/radio.css +1 -0
- package/packages/theme-chalk/lib/select-ganged.css +1 -0
- package/packages/theme-chalk/lib/select.css +0 -0
- package/packages/theme-chalk/lib/selector-panel.css +1 -0
- package/packages/theme-chalk/lib/selector.css +1 -0
- package/packages/theme-chalk/lib/sizer.css +1 -0
- package/packages/theme-chalk/lib/steps.css +1 -0
- package/packages/theme-chalk/lib/switch.css +1 -0
- package/packages/theme-chalk/lib/table-form.css +0 -0
- package/packages/theme-chalk/lib/tabs-panel.css +0 -0
- package/packages/theme-chalk/lib/tabs.css +1 -0
- package/packages/theme-chalk/lib/tips.css +1 -0
- package/packages/theme-chalk/lib/toolbar.css +1 -0
- package/packages/theme-chalk/lib/tree-group.css +1 -0
- package/packages/theme-chalk/lib/tree.css +1 -0
- package/packages/theme-chalk/lib/upload.css +1 -0
- package/packages/theme-chalk/lib/wujie.css +0 -0
- package/packages/theme-chalk/lib/wxlogin.css +1 -0
- package/packages/theme-chalk/package.json +35 -0
- package/packages/theme-chalk/src/base.scss +165 -0
- package/packages/theme-chalk/src/button-group.scss +9 -0
- package/packages/theme-chalk/src/button.scss +0 -0
- package/packages/theme-chalk/src/card.scss +55 -0
- package/packages/theme-chalk/src/cascader.scss +0 -0
- package/packages/theme-chalk/src/checkbox-group.scss +8 -0
- package/packages/theme-chalk/src/clients.scss +72 -0
- package/packages/theme-chalk/src/common/var.scss +1516 -0
- package/packages/theme-chalk/src/data-table-form.scss +55 -0
- package/packages/theme-chalk/src/data-table.scss +202 -0
- package/packages/theme-chalk/src/date-picker.scss +8 -0
- package/packages/theme-chalk/src/dialog.scss +52 -0
- package/packages/theme-chalk/src/enterprise.scss +5 -0
- package/packages/theme-chalk/src/error-page.scss +18 -0
- package/packages/theme-chalk/src/flow-chart.scss +0 -0
- package/packages/theme-chalk/src/flow-group.scss +101 -0
- package/packages/theme-chalk/src/flow-list.scss +41 -0
- package/packages/theme-chalk/src/flow.scss +285 -0
- package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/src/form.scss +451 -0
- package/packages/theme-chalk/src/handle-user.scss +40 -0
- package/packages/theme-chalk/src/handler.scss +131 -0
- package/packages/theme-chalk/src/icon.scss +1714 -0
- package/packages/theme-chalk/src/index.scss +50 -0
- package/packages/theme-chalk/src/input-number.scss +0 -0
- package/packages/theme-chalk/src/input.scss +3 -0
- package/packages/theme-chalk/src/label.scss +24 -0
- package/packages/theme-chalk/src/login.scss +490 -0
- package/packages/theme-chalk/src/main.scss +483 -0
- package/packages/theme-chalk/src/mainComp.scss +0 -0
- package/packages/theme-chalk/src/menu.scss +201 -0
- package/packages/theme-chalk/src/mixins/color.scss +117 -0
- package/packages/theme-chalk/src/mixins/mixins.scss +25 -0
- package/packages/theme-chalk/src/nav.scss +73 -0
- package/packages/theme-chalk/src/notify.scss +0 -0
- package/packages/theme-chalk/src/page.scss +3 -0
- package/packages/theme-chalk/src/pagination.scss +14 -0
- package/packages/theme-chalk/src/player.scss +9 -0
- package/packages/theme-chalk/src/qr-code.scss +17 -0
- package/packages/theme-chalk/src/radio-group.scss +9 -0
- package/packages/theme-chalk/src/radio.scss +3 -0
- package/packages/theme-chalk/src/select-ganged.scss +9 -0
- package/packages/theme-chalk/src/select.scss +0 -0
- package/packages/theme-chalk/src/selector-panel.scss +203 -0
- package/packages/theme-chalk/src/selector.scss +85 -0
- package/packages/theme-chalk/src/sizer.scss +36 -0
- package/packages/theme-chalk/src/steps.scss +88 -0
- package/packages/theme-chalk/src/switch.scss +3 -0
- package/packages/theme-chalk/src/table-form.scss +1 -0
- package/packages/theme-chalk/src/tabs-panel.scss +0 -0
- package/packages/theme-chalk/src/tabs.scss +91 -0
- package/packages/theme-chalk/src/tips.scss +7 -0
- package/packages/theme-chalk/src/toolbar.scss +121 -0
- package/packages/theme-chalk/src/tree-group.scss +64 -0
- package/packages/theme-chalk/src/tree.scss +140 -0
- package/packages/theme-chalk/src/upload.scss +131 -0
- package/packages/theme-chalk/src/wujie.scss +0 -0
- package/packages/theme-chalk/src/wxlogin.scss +3 -0
- package/packages/tips/index.js +5 -0
- package/packages/tips/src/main.vue +126 -0
- package/packages/toolbar/index.js +5 -0
- package/packages/toolbar/src/main.vue +377 -0
- package/packages/tree/index.js +5 -0
- package/packages/tree/src/main.vue +636 -0
- package/packages/tree-group/index.js +5 -0
- package/packages/tree-group/src/main.vue +435 -0
- package/packages/upload/index.js +5 -0
- package/packages/upload/src/main.vue +1033 -0
- package/packages/upload/src/picture.js +15 -0
- package/packages/wujie/index.js +5 -0
- package/packages/wujie/src/main.vue +137 -0
- package/packages/wxlogin/index.js +5 -0
- package/packages/wxlogin/src/main.vue +110 -0
- package/src/config/api.js +211 -0
- package/src/index.js +167 -0
- package/src/utils/bus.js +3 -0
- package/src/utils/date-util.js +312 -0
- package/src/utils/http.js +50 -0
- package/src/utils/rules.js +18 -0
- package/src/utils/store.js +21 -0
- package/src/utils/util.js +2105 -0
|
@@ -0,0 +1,1193 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="!code"
|
|
4
|
+
class="es-login-screen"
|
|
5
|
+
:style="{
|
|
6
|
+
'background-image': getImgUrl(loginBackgroundUrl)
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<img v-if="loginLogoUrl" class="es-login-logo" :src="loginLogoUrl" />
|
|
10
|
+
<slot></slot>
|
|
11
|
+
<div
|
|
12
|
+
class="es-login"
|
|
13
|
+
v-loading.fullscreen.lock="submit"
|
|
14
|
+
element-loading-text="登录中..."
|
|
15
|
+
element-loading-spinner="el-icon-loading"
|
|
16
|
+
element-loading-background="rgba(0, 0, 0, 0.65)"
|
|
17
|
+
:style="transform"
|
|
18
|
+
>
|
|
19
|
+
<img v-if="loginNameUrl" class="es-login-name" :src="loginNameUrl" />
|
|
20
|
+
<div
|
|
21
|
+
class="es-login-main"
|
|
22
|
+
:style="{
|
|
23
|
+
'background-image': getImgUrl(loginImageUrl)
|
|
24
|
+
}"
|
|
25
|
+
>
|
|
26
|
+
<div
|
|
27
|
+
v-if="switchs > 1"
|
|
28
|
+
:class="{
|
|
29
|
+
'es-login-switch': switchs == 2,
|
|
30
|
+
'es-login-switchs': switchs > 2
|
|
31
|
+
}"
|
|
32
|
+
>
|
|
33
|
+
<i
|
|
34
|
+
v-for="(item, index) in icons"
|
|
35
|
+
v-show="switchs > 2 || active != item.type"
|
|
36
|
+
@click="switchLogin(item.type)"
|
|
37
|
+
:title="switchs > 2 ? item.name : ''"
|
|
38
|
+
:key="index"
|
|
39
|
+
:class="[
|
|
40
|
+
item.icon,
|
|
41
|
+
'es-icon',
|
|
42
|
+
{ 'es-icon-active': active == item.type }
|
|
43
|
+
]"
|
|
44
|
+
></i>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="es-login-form-box">
|
|
47
|
+
<template v-if="isShow(active) && active == 0">
|
|
48
|
+
<el-form ref="login" class="es-login-form" :model="formData">
|
|
49
|
+
<div class="es-login-title">
|
|
50
|
+
<span class="es-login-title-content">{{ title }}</span>
|
|
51
|
+
</div>
|
|
52
|
+
<el-form-item
|
|
53
|
+
size="large"
|
|
54
|
+
prop="username"
|
|
55
|
+
:rules="username.rules"
|
|
56
|
+
>
|
|
57
|
+
<el-input
|
|
58
|
+
v-model="formData.username"
|
|
59
|
+
size="large"
|
|
60
|
+
type="text"
|
|
61
|
+
name="username"
|
|
62
|
+
:placeholder="username.placeholder"
|
|
63
|
+
@blur="handleBlur"
|
|
64
|
+
autocomplete="off"
|
|
65
|
+
>
|
|
66
|
+
<template slot="prefix">
|
|
67
|
+
<i class="es-icon-zhanghao es-label-user"></i>
|
|
68
|
+
</template>
|
|
69
|
+
</el-input>
|
|
70
|
+
</el-form-item>
|
|
71
|
+
<el-form-item
|
|
72
|
+
size="large"
|
|
73
|
+
prop="password"
|
|
74
|
+
:rules="password.rules"
|
|
75
|
+
>
|
|
76
|
+
<el-input
|
|
77
|
+
v-model="formData.password"
|
|
78
|
+
size="large"
|
|
79
|
+
name="password"
|
|
80
|
+
type="password"
|
|
81
|
+
:placeholder="password.placeholder"
|
|
82
|
+
autocomplete="off"
|
|
83
|
+
show-password
|
|
84
|
+
>
|
|
85
|
+
<template slot="prefix">
|
|
86
|
+
<i class="es-icon-mima es-label-password"></i>
|
|
87
|
+
</template>
|
|
88
|
+
</el-input>
|
|
89
|
+
</el-form-item>
|
|
90
|
+
<el-form-item
|
|
91
|
+
size="large"
|
|
92
|
+
prop="identifyingCode"
|
|
93
|
+
:rules="[{ required: true, message: '验证码不能为空' }]"
|
|
94
|
+
v-if="imgCode"
|
|
95
|
+
>
|
|
96
|
+
<el-input
|
|
97
|
+
size="large"
|
|
98
|
+
name="identifyingCode"
|
|
99
|
+
type="text"
|
|
100
|
+
v-model="formData.identifyingCode"
|
|
101
|
+
placeholder="请输入验证码"
|
|
102
|
+
autocomplete="off"
|
|
103
|
+
class="es-label-image-code"
|
|
104
|
+
>
|
|
105
|
+
<template slot="prefix">
|
|
106
|
+
<i class="es-icon-yanzheng es-label-code-image"></i>
|
|
107
|
+
</template>
|
|
108
|
+
<template slot="suffix">
|
|
109
|
+
<img
|
|
110
|
+
class="es-img-code"
|
|
111
|
+
:src="imageCode"
|
|
112
|
+
@click.stop="getImgCode"
|
|
113
|
+
/>
|
|
114
|
+
</template>
|
|
115
|
+
</el-input>
|
|
116
|
+
</el-form-item>
|
|
117
|
+
<div class="es-password-handle" v-show="remember && forget">
|
|
118
|
+
<el-checkbox
|
|
119
|
+
v-show="remember && active == '0'"
|
|
120
|
+
v-model="checked"
|
|
121
|
+
>记住密码</el-checkbox
|
|
122
|
+
>
|
|
123
|
+
<div v-show="forget" class="es-password-forget">
|
|
124
|
+
<span @click="handleForget">忘记密码?</span>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
<el-button
|
|
128
|
+
class="es-button-submit"
|
|
129
|
+
type="primary"
|
|
130
|
+
@click="handleLogin"
|
|
131
|
+
>登录</el-button
|
|
132
|
+
>
|
|
133
|
+
</el-form>
|
|
134
|
+
</template>
|
|
135
|
+
<template
|
|
136
|
+
v-if="isShow(active) && (active == 3 || active == 7 || active == 9)"
|
|
137
|
+
>
|
|
138
|
+
<div class="es-login-qrcode">
|
|
139
|
+
<div class="es-login-title">
|
|
140
|
+
<div class="es-login-title-content">
|
|
141
|
+
{{ iconfonts[active].name }}
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="es-login-down-app">
|
|
145
|
+
打开
|
|
146
|
+
<template v-if="active == 3">
|
|
147
|
+
<a class="es-login-app-name es-pointer" v-if="downloadApp"
|
|
148
|
+
>{{ app }}app</a
|
|
149
|
+
>
|
|
150
|
+
<span
|
|
151
|
+
class="es-login-app-name es-pointer"
|
|
152
|
+
v-else
|
|
153
|
+
@click="handleDownLoadApp"
|
|
154
|
+
>{{ app }}app
|
|
155
|
+
</span>
|
|
156
|
+
</template>
|
|
157
|
+
<span class="es-login-app-name" v-else
|
|
158
|
+
>{{ active == 7 ? '钉钉' : '微信' }}app </span
|
|
159
|
+
>,扫描二维码
|
|
160
|
+
</div>
|
|
161
|
+
<es-qr-code
|
|
162
|
+
:content="identifyingId"
|
|
163
|
+
v-if="active == 3"
|
|
164
|
+
></es-qr-code>
|
|
165
|
+
<div class="es-wx-qrcode-box" v-if="active == 9">
|
|
166
|
+
<es-wxlogin
|
|
167
|
+
href="data:text/css;base64,LmltcG93ZXJCb3ggLnFyY29kZSB7CiAgICB3aWR0aDogMTAwJSAhaW1wb3J0YW50OwogICAgYm94LXNpemluZzogYm9yZGVyLWJveCAhaW1wb3J0YW50OwogICAgbWFyZ2luOiAwICFpbXBvcnRhbnQ7Cn0KCi5pbXBvd2VyQm94IC5pbmZvLAouaW1wb3dlckJveCAudGl0bGUgewogICAgZGlzcGxheTogbm9uZSAhaW1wb3J0YW50Owp9"
|
|
168
|
+
height="300px"
|
|
169
|
+
:appid="wechatAppid"
|
|
170
|
+
:scope="wechatScope"
|
|
171
|
+
:redirect_uri="redirectUri"
|
|
172
|
+
></es-wxlogin>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</template>
|
|
176
|
+
<template v-if="isShow(active) && (active == 6 || active == 11)">
|
|
177
|
+
<el-form
|
|
178
|
+
ref="login"
|
|
179
|
+
class="es-login-form es-login-verify"
|
|
180
|
+
:model="formData"
|
|
181
|
+
>
|
|
182
|
+
<div class="es-login-title">
|
|
183
|
+
<span class="es-login-title-content">{{
|
|
184
|
+
iconfonts[active].name
|
|
185
|
+
}}</span>
|
|
186
|
+
</div>
|
|
187
|
+
<el-form-item
|
|
188
|
+
size="large"
|
|
189
|
+
prop="target"
|
|
190
|
+
:rules="active == 6 ? phone.rules : email.rules"
|
|
191
|
+
>
|
|
192
|
+
<el-input
|
|
193
|
+
v-model="formData.target"
|
|
194
|
+
size="large"
|
|
195
|
+
type="text"
|
|
196
|
+
name="target"
|
|
197
|
+
:placeholder="
|
|
198
|
+
active == 6 ? phone.placeholder : email.placeholder
|
|
199
|
+
"
|
|
200
|
+
@blur="handleBlur"
|
|
201
|
+
autocomplete="off"
|
|
202
|
+
>
|
|
203
|
+
<template slot="prefix">
|
|
204
|
+
<i class="es-icon-zhanghao es-label-user"></i>
|
|
205
|
+
</template>
|
|
206
|
+
</el-input>
|
|
207
|
+
</el-form-item>
|
|
208
|
+
<el-form-item
|
|
209
|
+
size="large"
|
|
210
|
+
prop="verificationCode"
|
|
211
|
+
:rules="[{ required: true, message: '验证码不能为空' }]"
|
|
212
|
+
>
|
|
213
|
+
<el-input
|
|
214
|
+
size="large"
|
|
215
|
+
name="verificationCode"
|
|
216
|
+
type="text"
|
|
217
|
+
v-model="formData.verificationCode"
|
|
218
|
+
placeholder="请输入验证码"
|
|
219
|
+
autocomplete="off"
|
|
220
|
+
class="es-label-image-code"
|
|
221
|
+
>
|
|
222
|
+
<template slot="prefix">
|
|
223
|
+
<i class="es-icon-yanzheng es-label-code-image"></i>
|
|
224
|
+
</template>
|
|
225
|
+
<template slot="suffix">
|
|
226
|
+
<el-button
|
|
227
|
+
class="es-get-code"
|
|
228
|
+
type="primary"
|
|
229
|
+
:disabled="disabled"
|
|
230
|
+
@click.stop="getCode"
|
|
231
|
+
>{{ btnText }}</el-button
|
|
232
|
+
>
|
|
233
|
+
</template>
|
|
234
|
+
</el-input>
|
|
235
|
+
</el-form-item>
|
|
236
|
+
<div class="es-password-handle" v-show="remember || forget">
|
|
237
|
+
<el-checkbox
|
|
238
|
+
v-show="remember && active == '0'"
|
|
239
|
+
v-model="checked"
|
|
240
|
+
>记住密码</el-checkbox
|
|
241
|
+
>
|
|
242
|
+
<div
|
|
243
|
+
v-show="forget"
|
|
244
|
+
class="es-password-forget"
|
|
245
|
+
@click="handleForget"
|
|
246
|
+
>
|
|
247
|
+
忘记密码?
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
<el-button
|
|
251
|
+
class="es-button-submit"
|
|
252
|
+
type="primary"
|
|
253
|
+
@click="handleLogin"
|
|
254
|
+
>登录</el-button
|
|
255
|
+
>
|
|
256
|
+
</el-form>
|
|
257
|
+
</template>
|
|
258
|
+
<div class="es-downloadSetup" v-if="downloadSetup">
|
|
259
|
+
<slot name="button"></slot>
|
|
260
|
+
<span @click="downloadExe">初次使用请下载一键安装包</span>
|
|
261
|
+
</div>
|
|
262
|
+
<div class="es-warning" v-if="warning">
|
|
263
|
+
{{ warnInfo }}
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
<div v-if="icp && icpInfo" class="es-login-icp">
|
|
269
|
+
<span class="es-login-icp-item" :style="icpStyle">{{
|
|
270
|
+
icpInfo.copyright_unit
|
|
271
|
+
}}</span>
|
|
272
|
+
<a
|
|
273
|
+
class="es-login-icp-item"
|
|
274
|
+
target="_blank"
|
|
275
|
+
:style="icpStyle"
|
|
276
|
+
:href="icpInfo.copyright_icp_url"
|
|
277
|
+
>{{ icpInfo.copyright_icp }}</a
|
|
278
|
+
>
|
|
279
|
+
</div>
|
|
280
|
+
<es-dialog
|
|
281
|
+
v-if="showResetPassword"
|
|
282
|
+
title="修改密码"
|
|
283
|
+
width="680px"
|
|
284
|
+
height="auto"
|
|
285
|
+
:visible.sync="showResetPassword"
|
|
286
|
+
>
|
|
287
|
+
<slot name="user" :secret="secret" :is-encrypt="isEncrypt">
|
|
288
|
+
<reset-password
|
|
289
|
+
:secret="secret"
|
|
290
|
+
:is-encrypt="isEncrypt"
|
|
291
|
+
:type="passModifyModel"
|
|
292
|
+
@success="handleSuccess"
|
|
293
|
+
></reset-password
|
|
294
|
+
></slot>
|
|
295
|
+
</es-dialog>
|
|
296
|
+
<es-dialog
|
|
297
|
+
title="客户端下载"
|
|
298
|
+
width="80%"
|
|
299
|
+
height="80%"
|
|
300
|
+
custom-class="es-clients-dialog"
|
|
301
|
+
:visible.sync="showDownLoadApp"
|
|
302
|
+
><es-clients v-bind="download"></es-clients>
|
|
303
|
+
</es-dialog>
|
|
304
|
+
</div>
|
|
305
|
+
</template>
|
|
306
|
+
<script>
|
|
307
|
+
import resetPassword from './resetPassword.vue';
|
|
308
|
+
import store from 'eoss-ui/src/utils/store';
|
|
309
|
+
import util from 'eoss-ui/src/utils/util';
|
|
310
|
+
import rules from 'eoss-ui/src/utils/rules.js';
|
|
311
|
+
import {
|
|
312
|
+
initLogin,
|
|
313
|
+
changeImg,
|
|
314
|
+
doUserLogin,
|
|
315
|
+
doQrLogin,
|
|
316
|
+
getLoginCode,
|
|
317
|
+
doCodeLogin,
|
|
318
|
+
doWechatQrLogin
|
|
319
|
+
} from 'eoss-ui/src/config/api.js';
|
|
320
|
+
export default {
|
|
321
|
+
name: 'EsLogin',
|
|
322
|
+
inheritAttrs: false,
|
|
323
|
+
components: {
|
|
324
|
+
resetPassword
|
|
325
|
+
},
|
|
326
|
+
props: {
|
|
327
|
+
//初始登录配置接口地址
|
|
328
|
+
initLogin: {
|
|
329
|
+
type: String,
|
|
330
|
+
default: initLogin
|
|
331
|
+
},
|
|
332
|
+
title: {
|
|
333
|
+
type: String,
|
|
334
|
+
default: '账号登录'
|
|
335
|
+
},
|
|
336
|
+
loginBackground: [String, Array],
|
|
337
|
+
loginImage: [String, Array],
|
|
338
|
+
loginLogo: String,
|
|
339
|
+
loginName: String,
|
|
340
|
+
type: String,
|
|
341
|
+
//是否加密传输
|
|
342
|
+
isEncrypt: {
|
|
343
|
+
type: Boolean,
|
|
344
|
+
default: true
|
|
345
|
+
},
|
|
346
|
+
model: {
|
|
347
|
+
type: Object,
|
|
348
|
+
default() {
|
|
349
|
+
return {};
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
username: {
|
|
353
|
+
type: Object,
|
|
354
|
+
default: () => {
|
|
355
|
+
return {
|
|
356
|
+
placeholder: '请输入账号',
|
|
357
|
+
rules: [{ required: true, message: '账号不能为空', trigger: 'blur' }]
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
phone: {
|
|
362
|
+
type: Object,
|
|
363
|
+
default: () => {
|
|
364
|
+
return {
|
|
365
|
+
placeholder: '请输入手机号',
|
|
366
|
+
rules: [
|
|
367
|
+
{ required: true, message: '手机号不能为空', trigger: 'blur' },
|
|
368
|
+
{
|
|
369
|
+
...rules.phone,
|
|
370
|
+
trigger: 'blur'
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
email: {
|
|
377
|
+
type: Object,
|
|
378
|
+
default: () => {
|
|
379
|
+
return {
|
|
380
|
+
placeholder: '请输入邮箱地址',
|
|
381
|
+
rules: [
|
|
382
|
+
{
|
|
383
|
+
required: true,
|
|
384
|
+
message: '请输入邮箱地址',
|
|
385
|
+
trigger: 'blur'
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
type: 'email',
|
|
389
|
+
message: '请输入正确的邮箱地址',
|
|
390
|
+
trigger: 'blur'
|
|
391
|
+
}
|
|
392
|
+
]
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
password: {
|
|
397
|
+
type: Object,
|
|
398
|
+
default: () => {
|
|
399
|
+
return {
|
|
400
|
+
placeholder: '请输入密码',
|
|
401
|
+
rules: [{ required: true, message: '密码不能为空', trigger: 'blur' }]
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
toUrl: String,
|
|
406
|
+
//账号登录接口地址
|
|
407
|
+
action: {
|
|
408
|
+
type: String,
|
|
409
|
+
default: doUserLogin
|
|
410
|
+
},
|
|
411
|
+
//扫码登录接口地址
|
|
412
|
+
scanAction: {
|
|
413
|
+
type: String,
|
|
414
|
+
default: doQrLogin
|
|
415
|
+
},
|
|
416
|
+
//图片验证码接口地址
|
|
417
|
+
codeAction: {
|
|
418
|
+
type: String,
|
|
419
|
+
default: changeImg
|
|
420
|
+
},
|
|
421
|
+
getLoginCode: {
|
|
422
|
+
type: String,
|
|
423
|
+
default: getLoginCode
|
|
424
|
+
},
|
|
425
|
+
doCodeLogin: {
|
|
426
|
+
type: String,
|
|
427
|
+
default: doCodeLogin
|
|
428
|
+
},
|
|
429
|
+
doWechatQrLogin: {
|
|
430
|
+
type: String,
|
|
431
|
+
default: doWechatQrLogin
|
|
432
|
+
},
|
|
433
|
+
imgCode: {
|
|
434
|
+
type: [Boolean, Object],
|
|
435
|
+
default: true
|
|
436
|
+
},
|
|
437
|
+
onLogin: Function,
|
|
438
|
+
onSuccess: Function,
|
|
439
|
+
onError: {
|
|
440
|
+
type: Function,
|
|
441
|
+
default: () => {}
|
|
442
|
+
},
|
|
443
|
+
doorIndex: {
|
|
444
|
+
type: Boolean,
|
|
445
|
+
default: true
|
|
446
|
+
},
|
|
447
|
+
storage: String,
|
|
448
|
+
warning: {
|
|
449
|
+
type: [Boolean, String],
|
|
450
|
+
default: false
|
|
451
|
+
},
|
|
452
|
+
icp: {
|
|
453
|
+
type: Boolean,
|
|
454
|
+
default: true
|
|
455
|
+
},
|
|
456
|
+
icpStyle: {
|
|
457
|
+
type: Object,
|
|
458
|
+
default() {
|
|
459
|
+
return { color: '#ffffff' };
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
appName: String,
|
|
463
|
+
qrImage: String,
|
|
464
|
+
forget: {
|
|
465
|
+
type: [Boolean, String],
|
|
466
|
+
default: true
|
|
467
|
+
},
|
|
468
|
+
remember: {
|
|
469
|
+
type: Boolean,
|
|
470
|
+
default: true
|
|
471
|
+
},
|
|
472
|
+
downloadApp: String,
|
|
473
|
+
onDownLoadApp: [Function, Boolean],
|
|
474
|
+
redirect_uri: String,
|
|
475
|
+
position: {
|
|
476
|
+
type: String,
|
|
477
|
+
default: 'center'
|
|
478
|
+
},
|
|
479
|
+
useResults: {
|
|
480
|
+
type: Boolean,
|
|
481
|
+
default: true
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
computed: {
|
|
485
|
+
transform() {
|
|
486
|
+
if (this.align === 'left') {
|
|
487
|
+
return {
|
|
488
|
+
left: '30%',
|
|
489
|
+
top: '50%',
|
|
490
|
+
transform: 'translateY(-51%)'
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
if (this.align === 'right') {
|
|
494
|
+
return {
|
|
495
|
+
left: '70%',
|
|
496
|
+
top: '50%',
|
|
497
|
+
transform: 'translateY(-51%)'
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
return {
|
|
501
|
+
left: '50%',
|
|
502
|
+
top: '50%',
|
|
503
|
+
transform: 'translate(-50%, -51%)'
|
|
504
|
+
};
|
|
505
|
+
},
|
|
506
|
+
redirectUri() {
|
|
507
|
+
if (this.redirect_uri) {
|
|
508
|
+
return this.redirect_uri;
|
|
509
|
+
} else {
|
|
510
|
+
return util.win.top.location.href || window.href;
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
loginBackgroundUrl() {
|
|
514
|
+
return this.loginBackground
|
|
515
|
+
? this.loginBackground
|
|
516
|
+
: this.loginBackgroundImg;
|
|
517
|
+
},
|
|
518
|
+
loginImageUrl() {
|
|
519
|
+
return this.loginImage ? this.loginImage : this.loginMainImg;
|
|
520
|
+
},
|
|
521
|
+
loginNameUrl() {
|
|
522
|
+
return this.loginNameImg ? this.loginNameImg : this.loginName;
|
|
523
|
+
},
|
|
524
|
+
loginLogoUrl() {
|
|
525
|
+
return this.loginLogoImg ? this.loginLogoImg : this.loginLogo;
|
|
526
|
+
},
|
|
527
|
+
warnInfo() {
|
|
528
|
+
return this.warning === false
|
|
529
|
+
? false
|
|
530
|
+
: typeof this.warning === 'string'
|
|
531
|
+
? this.warning
|
|
532
|
+
: '本系统为非涉密系统,禁止上传和处理任何涉密文件';
|
|
533
|
+
},
|
|
534
|
+
loginType() {
|
|
535
|
+
if (this.type) {
|
|
536
|
+
return this.type;
|
|
537
|
+
}
|
|
538
|
+
if (this.loginModel) {
|
|
539
|
+
return this.loginModel;
|
|
540
|
+
}
|
|
541
|
+
return '0';
|
|
542
|
+
},
|
|
543
|
+
switchs() {
|
|
544
|
+
return Array.isArray(this.loginType)
|
|
545
|
+
? this.loginType.length
|
|
546
|
+
: this.loginType.split(',').length;
|
|
547
|
+
},
|
|
548
|
+
iconfonts() {
|
|
549
|
+
const types = this.loginType.split(',');
|
|
550
|
+
return types.length > 2
|
|
551
|
+
? {
|
|
552
|
+
'0': { type: '0', icon: 'es-icon-shuru', name: '账号登录' },
|
|
553
|
+
'3': { type: '3', icon: 'es-icon-saoma', name: '扫码登录' },
|
|
554
|
+
'6': { type: '6', icon: 'es-icon-duanxin', name: '短信登录' },
|
|
555
|
+
'7': { type: '7', icon: 'es-icon-dingding', name: '钉钉扫码登录' },
|
|
556
|
+
'9': { type: '9', icon: 'es-icon-weixin', name: '微信扫码登录' },
|
|
557
|
+
'11': { type: '11', icon: 'es-icon-youxiang', name: '邮箱登录' }
|
|
558
|
+
}
|
|
559
|
+
: {
|
|
560
|
+
'0': { type: '0', icon: 'es-icon-jianpan', name: '账号登录' },
|
|
561
|
+
'3': { type: '3', icon: 'es-icon-qrcode', name: '扫码登录' },
|
|
562
|
+
'6': { type: '6', icon: 'es-icon-duanxin', name: '短信登录' },
|
|
563
|
+
'7': { type: '7', icon: 'es-icon-dingding', name: '钉钉扫码登录' },
|
|
564
|
+
'9': { type: '9', icon: 'es-icon-weixin', name: '微信扫码登录' },
|
|
565
|
+
'11': {
|
|
566
|
+
type: '11',
|
|
567
|
+
icon: 'es-icon-wodeyouxiang',
|
|
568
|
+
name: '邮箱登录'
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
},
|
|
572
|
+
icons() {
|
|
573
|
+
let icon = [];
|
|
574
|
+
const types = this.loginType.split(',');
|
|
575
|
+
types.forEach(item => {
|
|
576
|
+
icon.push(this.iconfonts[item]);
|
|
577
|
+
});
|
|
578
|
+
return icon;
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
watch: {
|
|
582
|
+
loginType: {
|
|
583
|
+
immediate: true,
|
|
584
|
+
handler(val) {
|
|
585
|
+
this.active = val.split(',')[0];
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
active: {
|
|
589
|
+
immediate: true,
|
|
590
|
+
handler(val) {
|
|
591
|
+
this.loginInfo(val == 3);
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
appName: {
|
|
595
|
+
immediate: true,
|
|
596
|
+
handler(val) {
|
|
597
|
+
if (val) {
|
|
598
|
+
this.app = val;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
qrImage: {
|
|
603
|
+
immediate: true,
|
|
604
|
+
handler(val) {
|
|
605
|
+
if (val) {
|
|
606
|
+
this.qrimg = val;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
checked(val) {
|
|
611
|
+
if (!val) {
|
|
612
|
+
localStorage.removeItem('unpd');
|
|
613
|
+
localStorage.removeItem('remember');
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
secret: {
|
|
617
|
+
immediate: true,
|
|
618
|
+
handler(val) {
|
|
619
|
+
if (val) {
|
|
620
|
+
if (this.storage) {
|
|
621
|
+
localStorage.setItem('storage', this.storage);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
data() {
|
|
628
|
+
return {
|
|
629
|
+
align: this.position,
|
|
630
|
+
loginBackgroundImg: null,
|
|
631
|
+
loginMainImg: null,
|
|
632
|
+
loginNameImg: null,
|
|
633
|
+
loginLogoImg: null,
|
|
634
|
+
loginModel: null,
|
|
635
|
+
passModifyModel: null,
|
|
636
|
+
active: 0,
|
|
637
|
+
submit: false,
|
|
638
|
+
checked: false,
|
|
639
|
+
formData: this.model,
|
|
640
|
+
imageCode: '',
|
|
641
|
+
secret: null,
|
|
642
|
+
identifyingId: '',
|
|
643
|
+
download: {},
|
|
644
|
+
setup: '',
|
|
645
|
+
sysName: '',
|
|
646
|
+
icpInfo: '',
|
|
647
|
+
forgetUrl: this.forget,
|
|
648
|
+
actionUrl: this.action,
|
|
649
|
+
downloadSetup: '',
|
|
650
|
+
app: '',
|
|
651
|
+
qrimg: '',
|
|
652
|
+
ios: '',
|
|
653
|
+
android: '',
|
|
654
|
+
pad: '',
|
|
655
|
+
ipad: '',
|
|
656
|
+
interval: null,
|
|
657
|
+
showResetPassword: false,
|
|
658
|
+
showDownLoadApp: false,
|
|
659
|
+
wechatAppid: null,
|
|
660
|
+
wechatScope: null,
|
|
661
|
+
disabled: false,
|
|
662
|
+
btnText: '获取验证码',
|
|
663
|
+
timer: null,
|
|
664
|
+
countdown: 0,
|
|
665
|
+
code: null,
|
|
666
|
+
defaultModel: JSON.parse(JSON.stringify(this.model))
|
|
667
|
+
};
|
|
668
|
+
},
|
|
669
|
+
created() {
|
|
670
|
+
this.code = util.getParams('code');
|
|
671
|
+
if (this.code) {
|
|
672
|
+
this.doWechatLogin(this.code);
|
|
673
|
+
} else {
|
|
674
|
+
this.getLogin();
|
|
675
|
+
document.addEventListener('keyup', this.doLogin);
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
mounted() {
|
|
679
|
+
this.getRemember();
|
|
680
|
+
},
|
|
681
|
+
methods: {
|
|
682
|
+
doWechatLogin(code) {
|
|
683
|
+
util
|
|
684
|
+
.ajax({
|
|
685
|
+
method: 'post',
|
|
686
|
+
url: this.doWechatQrLogin,
|
|
687
|
+
data: { code: code }
|
|
688
|
+
})
|
|
689
|
+
.then(res => {
|
|
690
|
+
if (res.rCode == 0) {
|
|
691
|
+
const results = res.results;
|
|
692
|
+
this.handleResults(results);
|
|
693
|
+
} else {
|
|
694
|
+
const msg =
|
|
695
|
+
res.results && res.results.msg ? res.results.msg : res.msg;
|
|
696
|
+
this.$message({
|
|
697
|
+
message: msg || '系统错误,请联系管理员!',
|
|
698
|
+
type: 'error',
|
|
699
|
+
duration: 1500,
|
|
700
|
+
onClose: () => {
|
|
701
|
+
window.location.href = util.delUrlParam({ key: 'code' });
|
|
702
|
+
if (window.location.hash) {
|
|
703
|
+
location.reload();
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
})
|
|
709
|
+
.catch(err => {
|
|
710
|
+
if (err.message && err.message !== 'canceled') {
|
|
711
|
+
this.$message.error(err.message);
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
},
|
|
715
|
+
getImgUrl(urls) {
|
|
716
|
+
let url = '';
|
|
717
|
+
if (!urls || !urls.length) {
|
|
718
|
+
return url;
|
|
719
|
+
}
|
|
720
|
+
if (Array.isArray(urls)) {
|
|
721
|
+
url = urls
|
|
722
|
+
.map(item => {
|
|
723
|
+
return `url(${item})`;
|
|
724
|
+
})
|
|
725
|
+
.join(',');
|
|
726
|
+
} else {
|
|
727
|
+
url = `url(${urls})`;
|
|
728
|
+
}
|
|
729
|
+
return url;
|
|
730
|
+
},
|
|
731
|
+
getRemember(user) {
|
|
732
|
+
if (!user) {
|
|
733
|
+
user = localStorage.getItem('remember');
|
|
734
|
+
if (user) {
|
|
735
|
+
user = util.esDecode(user);
|
|
736
|
+
} else {
|
|
737
|
+
return false;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
let values = localStorage.getItem('unpd');
|
|
741
|
+
let value = {};
|
|
742
|
+
if (values) {
|
|
743
|
+
values = JSON.parse(values);
|
|
744
|
+
for (let i in values) {
|
|
745
|
+
value[util.esDecode(i)] = util.esDecode(values[i]);
|
|
746
|
+
}
|
|
747
|
+
if (value[user]) {
|
|
748
|
+
this.checked = true;
|
|
749
|
+
}
|
|
750
|
+
this.$set(this.formData, 'username', user);
|
|
751
|
+
this.$set(this.formData, 'password', value[user]);
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
handleBlur() {
|
|
755
|
+
if (this.formData.username && !this.formData.password) {
|
|
756
|
+
this.getRemember(this.formData.username);
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
handleRemember() {
|
|
760
|
+
let values = localStorage.getItem('unpd');
|
|
761
|
+
let value = {};
|
|
762
|
+
if (values) {
|
|
763
|
+
values = JSON.parse(values);
|
|
764
|
+
for (let i in values) {
|
|
765
|
+
value[util.esDecode(i)] = util.esDecode(values[i]);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
if (this.checked) {
|
|
769
|
+
localStorage.setItem('remember', util.esEncode(this.formData.username));
|
|
770
|
+
value[this.formData.username] = this.formData.password;
|
|
771
|
+
let data = {};
|
|
772
|
+
for (let i in value) {
|
|
773
|
+
data[util.esEncode(i)] = util.esEncode(value[i]);
|
|
774
|
+
}
|
|
775
|
+
localStorage.setItem('unpd', JSON.stringify(data));
|
|
776
|
+
} else {
|
|
777
|
+
delete value[this.formData.username];
|
|
778
|
+
if (Object.keys(value)) {
|
|
779
|
+
let data = {};
|
|
780
|
+
for (let i in value) {
|
|
781
|
+
data[util.esEncode(i)] = util.esEncode(value[i]);
|
|
782
|
+
}
|
|
783
|
+
localStorage.setItem('unpd', JSON.stringify(data));
|
|
784
|
+
} else {
|
|
785
|
+
localStorage.removeItem('unpd');
|
|
786
|
+
}
|
|
787
|
+
localStorage.removeItem('remember');
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
// 下载app的弹窗
|
|
791
|
+
handleDownLoadApp() {
|
|
792
|
+
if (this.onDownLoadApp) {
|
|
793
|
+
if (typeof this.onDownLoadApp === 'function') {
|
|
794
|
+
this.onDownLoadApp();
|
|
795
|
+
} else {
|
|
796
|
+
this.$emit('handleDownLoadApp');
|
|
797
|
+
}
|
|
798
|
+
} else {
|
|
799
|
+
this.showDownLoadApp = true;
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
switchLogin(res) {
|
|
803
|
+
//this.$refs.login && this.$refs.login.resetFields();
|
|
804
|
+
this.$refs.login && this.$refs.login.clearValidate();
|
|
805
|
+
|
|
806
|
+
this.active = res;
|
|
807
|
+
this.formData = JSON.parse(JSON.stringify(this.defaultModel));
|
|
808
|
+
},
|
|
809
|
+
isShow(res) {
|
|
810
|
+
return this.loginType.indexOf(res) > -1;
|
|
811
|
+
},
|
|
812
|
+
getLogin() {
|
|
813
|
+
const config = store.get('initLogin');
|
|
814
|
+
if (config) {
|
|
815
|
+
this.setConfig(config);
|
|
816
|
+
} else {
|
|
817
|
+
util
|
|
818
|
+
.ajax({ url: this.initLogin })
|
|
819
|
+
.then(res => {
|
|
820
|
+
if (res && res.rCode === 0) {
|
|
821
|
+
store.set('initLogin', res.results);
|
|
822
|
+
util.setStorage({
|
|
823
|
+
type: this.storage,
|
|
824
|
+
key: 'initLogin',
|
|
825
|
+
value: JSON.stringify(res.results)
|
|
826
|
+
});
|
|
827
|
+
this.setConfig(res.results);
|
|
828
|
+
} else {
|
|
829
|
+
this.$message({
|
|
830
|
+
message: res.msg || '系统错误,请联系管理员!',
|
|
831
|
+
type: 'error',
|
|
832
|
+
duration: 2000
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
})
|
|
836
|
+
.catch(err => {
|
|
837
|
+
if (err.message && err.message !== 'canceled') {
|
|
838
|
+
this.$message.error(err.message);
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
setConfig(res) {
|
|
844
|
+
const host = util.getStorage('host');
|
|
845
|
+
this.identifyingId = res.identifyingId;
|
|
846
|
+
this.getImgCode();
|
|
847
|
+
this.download = {
|
|
848
|
+
android: res.androidDownloadUrl,
|
|
849
|
+
ios: res.iosDownloadUrl || res.iosDownloadUrl2
|
|
850
|
+
};
|
|
851
|
+
this.secret = res.secret;
|
|
852
|
+
this.setup = res.setup;
|
|
853
|
+
this.sysName = res.subsystemName;
|
|
854
|
+
this.downloadSetup = res.downloadSetup;
|
|
855
|
+
document.title = res.subsystemName;
|
|
856
|
+
this.app = res.appName || res.subsystemName;
|
|
857
|
+
this.qrimg = res.qrimg || res.qrImg;
|
|
858
|
+
this.loginModel = res.loginModel;
|
|
859
|
+
this.loginBackgroundImg = res.loginBackgroundUrl
|
|
860
|
+
? res.loginBackgroundUrl.split(',')
|
|
861
|
+
: null;
|
|
862
|
+
this.loginLogoImg = res.loginLogoUrl ? res.loginLogoUrl : null;
|
|
863
|
+
if (res.subsystemExtend && Object.keys(res.subsystemExtend).length) {
|
|
864
|
+
this.icpInfo = res.subsystemExtend;
|
|
865
|
+
this.forgetUrl = res.subsystemExtend.look_pass_url;
|
|
866
|
+
if (res.subsystemExtend.login_url) {
|
|
867
|
+
this.actionUrl = res.subsystemExtend.login_url;
|
|
868
|
+
}
|
|
869
|
+
if (res.subsystemExtend.applicationName) {
|
|
870
|
+
localStorage.setItem('appcode', res.subsystemExtend.applicationName);
|
|
871
|
+
}
|
|
872
|
+
this.loginMainImg = res.subsystemExtend.loginBoxBackground
|
|
873
|
+
? res.subsystemExtend.loginBoxBackground.split(',')
|
|
874
|
+
: null;
|
|
875
|
+
this.loginNameImg = res.subsystemExtend.loginBoxName
|
|
876
|
+
? res.subsystemExtend.loginBoxName.split(',')
|
|
877
|
+
: null;
|
|
878
|
+
if (res.subsystemExtend.loginBoxAlign && this.useResults) {
|
|
879
|
+
this.align = res.subsystemExtend.loginBoxAlign;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
this.passModifyModel = res.passModifyModel;
|
|
883
|
+
this.wechatAppid = res.wechatAppid;
|
|
884
|
+
this.wechatScope = res.wechatScope;
|
|
885
|
+
if (res.sysLogoIco) {
|
|
886
|
+
util.setFavicon(res.sysLogoIco);
|
|
887
|
+
}
|
|
888
|
+
},
|
|
889
|
+
|
|
890
|
+
getImgCode() {
|
|
891
|
+
if (this.identifyingId === '') {
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
this.imageCode =
|
|
895
|
+
util.getStorage('host') +
|
|
896
|
+
this.codeAction +
|
|
897
|
+
'?identifyingId=' +
|
|
898
|
+
this.identifyingId +
|
|
899
|
+
(this.imgCode && typeof this.imgCode == 'object'
|
|
900
|
+
? '&' + util.queryParams(this.imgCode)
|
|
901
|
+
: '') +
|
|
902
|
+
'&heightflag=' +
|
|
903
|
+
Math.random();
|
|
904
|
+
|
|
905
|
+
return this.imageCode;
|
|
906
|
+
},
|
|
907
|
+
getCode() {
|
|
908
|
+
if (this.countdown) {
|
|
909
|
+
return false;
|
|
910
|
+
}
|
|
911
|
+
if (!this.formData.target) {
|
|
912
|
+
this.$refs.login.validateField('target');
|
|
913
|
+
return false;
|
|
914
|
+
} else {
|
|
915
|
+
let flag = false;
|
|
916
|
+
this.$refs.login.validateField('target', res => {
|
|
917
|
+
flag = res != '';
|
|
918
|
+
});
|
|
919
|
+
if (flag) {
|
|
920
|
+
return false;
|
|
921
|
+
}
|
|
922
|
+
let data = {
|
|
923
|
+
target: this.formData.target,
|
|
924
|
+
targetType: this.active == '6' ? 'SMS' : 'EMAIL'
|
|
925
|
+
};
|
|
926
|
+
this.countdown = 60;
|
|
927
|
+
this.timer = setInterval(() => {
|
|
928
|
+
if (this.countdown > 0) {
|
|
929
|
+
this.countdown--;
|
|
930
|
+
this.disabled = true;
|
|
931
|
+
this.btnText = '重新获取' + this.countdown + 's';
|
|
932
|
+
} else {
|
|
933
|
+
this.btnText = '重新获取';
|
|
934
|
+
this.disabled = false;
|
|
935
|
+
}
|
|
936
|
+
}, 1000);
|
|
937
|
+
util
|
|
938
|
+
.ajax({
|
|
939
|
+
method: 'post',
|
|
940
|
+
url: this.getLoginCode,
|
|
941
|
+
data: data
|
|
942
|
+
})
|
|
943
|
+
.then(res => {
|
|
944
|
+
this.$message({
|
|
945
|
+
message: res.msg,
|
|
946
|
+
duration: 2000,
|
|
947
|
+
type: res ? 'error' : 'success'
|
|
948
|
+
});
|
|
949
|
+
// if (res.rCode) {
|
|
950
|
+
// clearInterval(this.timer);
|
|
951
|
+
// }
|
|
952
|
+
})
|
|
953
|
+
.catch(err => {
|
|
954
|
+
if (err.message && err.message !== 'canceled') {
|
|
955
|
+
this.$message.error(err.message);
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
handleLogin() {
|
|
961
|
+
if (this.submit) {
|
|
962
|
+
return false;
|
|
963
|
+
}
|
|
964
|
+
this.$refs['login'].validate(valid => {
|
|
965
|
+
if (valid) {
|
|
966
|
+
this.submit = true;
|
|
967
|
+
const data =
|
|
968
|
+
this.active == '0'
|
|
969
|
+
? {
|
|
970
|
+
username: this.formData.username,
|
|
971
|
+
password:
|
|
972
|
+
this.secret && this.isEncrypt
|
|
973
|
+
? util.esmEncrypt({
|
|
974
|
+
data: this.formData.password,
|
|
975
|
+
key: this.secret
|
|
976
|
+
})
|
|
977
|
+
: this.formData.password,
|
|
978
|
+
identifyingCode: this.formData.identifyingCode,
|
|
979
|
+
identifyingId: this.identifyingId
|
|
980
|
+
}
|
|
981
|
+
: {
|
|
982
|
+
target: this.formData.target,
|
|
983
|
+
verificationCode: this.formData.verificationCode,
|
|
984
|
+
targetType: this.active == '6' ? 'SMS' : 'EMAIL'
|
|
985
|
+
};
|
|
986
|
+
if (this.onLogin) {
|
|
987
|
+
if (this.active == '0') {
|
|
988
|
+
this.onLogin(data, this.getImgCode, this.handleRemember);
|
|
989
|
+
} else {
|
|
990
|
+
this.onLogin(data);
|
|
991
|
+
}
|
|
992
|
+
} else {
|
|
993
|
+
this.handleUserLogin(data);
|
|
994
|
+
}
|
|
995
|
+
} else {
|
|
996
|
+
this.submit = false;
|
|
997
|
+
return false;
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
},
|
|
1001
|
+
doLogin(e) {
|
|
1002
|
+
if (util.win.event == undefined) {
|
|
1003
|
+
var key = e.keyCode;
|
|
1004
|
+
} else {
|
|
1005
|
+
var key = util.win.event.keyCode;
|
|
1006
|
+
}
|
|
1007
|
+
if (key == 13) {
|
|
1008
|
+
this.handleLogin();
|
|
1009
|
+
}
|
|
1010
|
+
},
|
|
1011
|
+
handleUserLogin(data) {
|
|
1012
|
+
util
|
|
1013
|
+
.ajax({
|
|
1014
|
+
method: 'post',
|
|
1015
|
+
url: this.active == '0' ? this.actionUrl : this.doCodeLogin,
|
|
1016
|
+
data: data
|
|
1017
|
+
})
|
|
1018
|
+
.then(res => {
|
|
1019
|
+
this.submit = false;
|
|
1020
|
+
if (res.rCode == 0) {
|
|
1021
|
+
this.handleRemember();
|
|
1022
|
+
const results = res.results;
|
|
1023
|
+
this.handleResults(results);
|
|
1024
|
+
if (this.onSuccess) {
|
|
1025
|
+
this.onSuccess(res);
|
|
1026
|
+
}
|
|
1027
|
+
} else {
|
|
1028
|
+
const msg =
|
|
1029
|
+
res.results && res.results.msg ? res.results.msg : res.msg;
|
|
1030
|
+
this.$message({
|
|
1031
|
+
message: msg || '系统错误,请联系管理员!',
|
|
1032
|
+
type: 'error',
|
|
1033
|
+
duration: 1500,
|
|
1034
|
+
onClose: () => {
|
|
1035
|
+
this.getImgCode();
|
|
1036
|
+
}
|
|
1037
|
+
});
|
|
1038
|
+
this.onError(res);
|
|
1039
|
+
}
|
|
1040
|
+
})
|
|
1041
|
+
.catch(err => {
|
|
1042
|
+
if (err.message && err.message !== 'canceled') {
|
|
1043
|
+
this.$message.error(err.message);
|
|
1044
|
+
}
|
|
1045
|
+
});
|
|
1046
|
+
},
|
|
1047
|
+
handleForget() {
|
|
1048
|
+
if (typeof this.forget === 'string') {
|
|
1049
|
+
util.win.open(this.forgetUrl);
|
|
1050
|
+
} else {
|
|
1051
|
+
this.showResetPassword = true;
|
|
1052
|
+
}
|
|
1053
|
+
},
|
|
1054
|
+
downloadExe() {
|
|
1055
|
+
util.win.open(this.downloadSetup);
|
|
1056
|
+
},
|
|
1057
|
+
//获取app登录信息
|
|
1058
|
+
loginInfo(res) {
|
|
1059
|
+
clearInterval(this.interval);
|
|
1060
|
+
if (res) {
|
|
1061
|
+
//this.modifyPasswordfun();
|
|
1062
|
+
this.interval = setInterval(() => {
|
|
1063
|
+
this.initRequestLoginInfo();
|
|
1064
|
+
}, 1000);
|
|
1065
|
+
}
|
|
1066
|
+
},
|
|
1067
|
+
initRequestLoginInfo() {
|
|
1068
|
+
util
|
|
1069
|
+
.ajax({
|
|
1070
|
+
method: 'post',
|
|
1071
|
+
url: this.scanAction,
|
|
1072
|
+
data: {
|
|
1073
|
+
identifyingId: this.identifyingId
|
|
1074
|
+
}
|
|
1075
|
+
})
|
|
1076
|
+
.then(res => {
|
|
1077
|
+
if (res.rCode === 0) {
|
|
1078
|
+
const results = res.results;
|
|
1079
|
+
this.handleResults(results, 3);
|
|
1080
|
+
}
|
|
1081
|
+
})
|
|
1082
|
+
.catch(err => {
|
|
1083
|
+
clearInterval(this.interval);
|
|
1084
|
+
if (err.message && err.message !== 'canceled') {
|
|
1085
|
+
this.$message.error(err.message);
|
|
1086
|
+
}
|
|
1087
|
+
});
|
|
1088
|
+
},
|
|
1089
|
+
handleResults(results, type) {
|
|
1090
|
+
this.loginInfo(false);
|
|
1091
|
+
switch (results.statusCode) {
|
|
1092
|
+
case 0:
|
|
1093
|
+
util.setStorage({
|
|
1094
|
+
type: this.storage,
|
|
1095
|
+
key: {
|
|
1096
|
+
ssId: results.ssId,
|
|
1097
|
+
token: results.token,
|
|
1098
|
+
Authorization: results.token,
|
|
1099
|
+
deviceUnique: results.deviceUnique,
|
|
1100
|
+
userId: results.userId,
|
|
1101
|
+
userName: results.username,
|
|
1102
|
+
useCaseCodes: results.resourceCodes
|
|
1103
|
+
}
|
|
1104
|
+
});
|
|
1105
|
+
this.$message({
|
|
1106
|
+
message: '登录成功!',
|
|
1107
|
+
type: 'success',
|
|
1108
|
+
duration: 1500,
|
|
1109
|
+
onClose: () => {
|
|
1110
|
+
if (this.toUrl) {
|
|
1111
|
+
util.win.location.href = this.toUrl;
|
|
1112
|
+
} else if (results.doorIndex && this.doorIndex) {
|
|
1113
|
+
util.win.location.href = results.doorIndex;
|
|
1114
|
+
} else {
|
|
1115
|
+
if (util.win.top.location.href.indexOf('login.html') > -1) {
|
|
1116
|
+
util.win.top.location.href = './main.html';
|
|
1117
|
+
} else {
|
|
1118
|
+
this.$router.push({ name: 'main' });
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
util.removeStorage('timer');
|
|
1122
|
+
}
|
|
1123
|
+
});
|
|
1124
|
+
break;
|
|
1125
|
+
case 2:
|
|
1126
|
+
this.$confirm(
|
|
1127
|
+
results.msg ? results.msg : '密码太简单了, 请修改密码?',
|
|
1128
|
+
'提示',
|
|
1129
|
+
{
|
|
1130
|
+
confirmButtonText: '确定',
|
|
1131
|
+
//cancelButtonText: '取消',
|
|
1132
|
+
type: 'warning'
|
|
1133
|
+
}
|
|
1134
|
+
)
|
|
1135
|
+
.then(() => {
|
|
1136
|
+
if (typeof this.forget === 'string') {
|
|
1137
|
+
util.win.open(this.forgetUrl);
|
|
1138
|
+
} else {
|
|
1139
|
+
this.showResetPassword = true;
|
|
1140
|
+
}
|
|
1141
|
+
})
|
|
1142
|
+
.catch(e => {});
|
|
1143
|
+
break;
|
|
1144
|
+
case 3:
|
|
1145
|
+
let url =
|
|
1146
|
+
results.doorIndex && this.doorIndex
|
|
1147
|
+
? results.doorIndex
|
|
1148
|
+
: util.win.top.location.href.indexOf('main.html') > -1
|
|
1149
|
+
? './login.html'
|
|
1150
|
+
: util.win.location.hash
|
|
1151
|
+
? util.win.location.href.replace('login', 'main')
|
|
1152
|
+
: util.win.location.href;
|
|
1153
|
+
const href = results.authorizeUrl.replace(
|
|
1154
|
+
'{redirectUri}',
|
|
1155
|
+
encodeURIComponent(url)
|
|
1156
|
+
);
|
|
1157
|
+
util.win.top.location.href = href;
|
|
1158
|
+
// util.win.location.href =
|
|
1159
|
+
// results.authorizeUrl.indexOf('?') > -1
|
|
1160
|
+
// ? results.authorizeUrl + '&token=' + results.token
|
|
1161
|
+
// : results.authorizeUrl + '?token=' + results.token;
|
|
1162
|
+
break;
|
|
1163
|
+
default:
|
|
1164
|
+
if (type !== 3) {
|
|
1165
|
+
this.$message({
|
|
1166
|
+
message: results.msg || res.msg,
|
|
1167
|
+
type: 'error',
|
|
1168
|
+
duration: 1500,
|
|
1169
|
+
onClose: () => {
|
|
1170
|
+
if (this.code) {
|
|
1171
|
+
window.location.href = util.delUrlParam({ key: 'code' });
|
|
1172
|
+
if (window.location.hash) {
|
|
1173
|
+
location.reload();
|
|
1174
|
+
}
|
|
1175
|
+
} else {
|
|
1176
|
+
this.getImgCode();
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
} else if (this.active == 3) {
|
|
1181
|
+
this.loginInfo(true);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
handleSuccess() {
|
|
1186
|
+
this.showResetPassword = false;
|
|
1187
|
+
}
|
|
1188
|
+
},
|
|
1189
|
+
beforeDestroy() {
|
|
1190
|
+
document.removeEventListener('keyup', this.doLogin);
|
|
1191
|
+
}
|
|
1192
|
+
};
|
|
1193
|
+
</script>
|