system-phone 3.1.47 → 3.1.48

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 (211) hide show
  1. package/.babelrc +5 -5
  2. package/.editorconfig +9 -9
  3. package/.eslintrc.js +16 -16
  4. package/.gradle/7.4/checksums/checksums.lock +0 -0
  5. package/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  6. package/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
  7. package/.gradle/7.4/executionHistory/executionHistory.bin +0 -0
  8. package/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
  9. package/.gradle/7.4/fileChanges/last-build.bin +0 -0
  10. package/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
  11. package/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  12. package/.gradle/7.4/gc.properties +0 -0
  13. package/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  14. package/.gradle/checksums/checksums.lock +0 -0
  15. package/.gradle/checksums/md5-checksums.bin +0 -0
  16. package/.gradle/checksums/sha1-checksums.bin +0 -0
  17. package/.gradle/file-system.probe +0 -0
  18. package/CHANGELOG.md +1 -1
  19. package/Dockerfile +3 -3
  20. package/README.md +36 -36
  21. package/build/css-loaders.js +34 -34
  22. package/build/dev-client.js +8 -8
  23. package/build/example-server.js +80 -80
  24. package/build/release.sh +28 -28
  25. package/build/utils.js +71 -71
  26. package/build/webpack.dev.conf.js +31 -31
  27. package/build/webpack.example.conf.js +49 -49
  28. package/build/webpack.prod.conf.js +60 -60
  29. package/build/webpack.test.conf.js +31 -31
  30. package/config/dev.env.js +6 -6
  31. package/config/index.js +38 -38
  32. package/config/prod.env.js +3 -3
  33. package/config/test.env.js +6 -6
  34. package/nginx.conf +304 -304
  35. package/package.json +1 -1
  36. package/release.bat +5 -5
  37. package/src/App.vue +25 -25
  38. package/src/Util.js +415 -415
  39. package/src/android-bootstrap/fonts/glyphicons-halflings-regular.svg +287 -287
  40. package/src/android-bootstrap/less/.csscomb.json +304 -304
  41. package/src/android-bootstrap/less/.csslintrc +19 -19
  42. package/src/android-bootstrap/less/alerts.less +73 -73
  43. package/src/android-bootstrap/less/badges.less +66 -66
  44. package/src/android-bootstrap/less/bootstrap.less +56 -56
  45. package/src/android-bootstrap/less/breadcrumbs.less +26 -26
  46. package/src/android-bootstrap/less/button-groups.less +247 -247
  47. package/src/android-bootstrap/less/buttons.less +173 -173
  48. package/src/android-bootstrap/less/carousel.less +269 -269
  49. package/src/android-bootstrap/less/close.less +34 -34
  50. package/src/android-bootstrap/less/code.less +69 -69
  51. package/src/android-bootstrap/less/component-animations.less +33 -33
  52. package/src/android-bootstrap/less/dropdowns.less +216 -216
  53. package/src/android-bootstrap/less/forms.less +626 -626
  54. package/src/android-bootstrap/less/glyphicons.less +305 -305
  55. package/src/android-bootstrap/less/grid.less +84 -84
  56. package/src/android-bootstrap/less/input-groups.less +167 -167
  57. package/src/android-bootstrap/less/jumbotron.less +52 -52
  58. package/src/android-bootstrap/less/labels.less +64 -64
  59. package/src/android-bootstrap/less/list-group.less +141 -141
  60. package/src/android-bootstrap/less/media.less +66 -66
  61. package/src/android-bootstrap/less/mixins/alerts.less +14 -14
  62. package/src/android-bootstrap/less/mixins/background-variant.less +9 -9
  63. package/src/android-bootstrap/less/mixins/border-radius.less +18 -18
  64. package/src/android-bootstrap/less/mixins/buttons.less +69 -69
  65. package/src/android-bootstrap/less/mixins/center-block.less +7 -7
  66. package/src/android-bootstrap/less/mixins/clearfix.less +22 -22
  67. package/src/android-bootstrap/less/mixins/forms.less +90 -90
  68. package/src/android-bootstrap/less/mixins/gradients.less +59 -59
  69. package/src/android-bootstrap/less/mixins/grid-framework.less +92 -92
  70. package/src/android-bootstrap/less/mixins/grid.less +122 -122
  71. package/src/android-bootstrap/less/mixins/hide-text.less +21 -21
  72. package/src/android-bootstrap/less/mixins/image.less +33 -33
  73. package/src/android-bootstrap/less/mixins/labels.less +12 -12
  74. package/src/android-bootstrap/less/mixins/list-group.less +30 -30
  75. package/src/android-bootstrap/less/mixins/nav-divider.less +10 -10
  76. package/src/android-bootstrap/less/mixins/nav-vertical-align.less +9 -9
  77. package/src/android-bootstrap/less/mixins/opacity.less +8 -8
  78. package/src/android-bootstrap/less/mixins/pagination.less +24 -24
  79. package/src/android-bootstrap/less/mixins/panels.less +24 -24
  80. package/src/android-bootstrap/less/mixins/progress-bar.less +10 -10
  81. package/src/android-bootstrap/less/mixins/reset-filter.less +8 -8
  82. package/src/android-bootstrap/less/mixins/reset-text.less +18 -18
  83. package/src/android-bootstrap/less/mixins/resize.less +6 -6
  84. package/src/android-bootstrap/less/mixins/responsive-visibility.less +15 -15
  85. package/src/android-bootstrap/less/mixins/size.less +10 -10
  86. package/src/android-bootstrap/less/mixins/tab-focus.less +9 -9
  87. package/src/android-bootstrap/less/mixins/table-row.less +44 -44
  88. package/src/android-bootstrap/less/mixins/text-emphasis.less +9 -9
  89. package/src/android-bootstrap/less/mixins/text-overflow.less +8 -8
  90. package/src/android-bootstrap/less/mixins/vendor-prefixes.less +227 -227
  91. package/src/android-bootstrap/less/mixins.less +40 -40
  92. package/src/android-bootstrap/less/modals.less +151 -151
  93. package/src/android-bootstrap/less/navbar.less +660 -660
  94. package/src/android-bootstrap/less/navs.less +290 -290
  95. package/src/android-bootstrap/less/normalize.less +424 -424
  96. package/src/android-bootstrap/less/pager.less +76 -76
  97. package/src/android-bootstrap/less/pagination.less +89 -89
  98. package/src/android-bootstrap/less/panels.less +274 -274
  99. package/src/android-bootstrap/less/popovers.less +131 -131
  100. package/src/android-bootstrap/less/print.less +101 -101
  101. package/src/android-bootstrap/less/progress-bars.less +87 -87
  102. package/src/android-bootstrap/less/responsive-embed.less +35 -35
  103. package/src/android-bootstrap/less/responsive-utilities.less +194 -194
  104. package/src/android-bootstrap/less/scaffolding.less +161 -161
  105. package/src/android-bootstrap/less/tables.less +262 -262
  106. package/src/android-bootstrap/less/theme.less +291 -291
  107. package/src/android-bootstrap/less/thumbnails.less +36 -36
  108. package/src/android-bootstrap/less/tooltip.less +102 -102
  109. package/src/android-bootstrap/less/type.less +303 -303
  110. package/src/android-bootstrap/less/utilities.less +55 -55
  111. package/src/android-bootstrap/less/variables.less +896 -896
  112. package/src/android-bootstrap/less/wells.less +29 -29
  113. package/src/bootstrap/fonts/glyphicons-halflings-regular.svg +287 -287
  114. package/src/bootstrap/less/.csscomb.json +304 -304
  115. package/src/bootstrap/less/.csslintrc +19 -19
  116. package/src/bootstrap/less/alerts.less +73 -73
  117. package/src/bootstrap/less/badges.less +66 -66
  118. package/src/bootstrap/less/bootstrap.less +56 -56
  119. package/src/bootstrap/less/breadcrumbs.less +26 -26
  120. package/src/bootstrap/less/button-groups.less +247 -247
  121. package/src/bootstrap/less/buttons.less +172 -172
  122. package/src/bootstrap/less/carousel.less +269 -269
  123. package/src/bootstrap/less/close.less +34 -34
  124. package/src/bootstrap/less/code.less +69 -69
  125. package/src/bootstrap/less/component-animations.less +33 -33
  126. package/src/bootstrap/less/dropdowns.less +216 -216
  127. package/src/bootstrap/less/forms.less +626 -626
  128. package/src/bootstrap/less/glyphicons.less +305 -305
  129. package/src/bootstrap/less/grid.less +84 -84
  130. package/src/bootstrap/less/input-groups.less +167 -167
  131. package/src/bootstrap/less/jumbotron.less +52 -52
  132. package/src/bootstrap/less/labels.less +64 -64
  133. package/src/bootstrap/less/list-group.less +141 -141
  134. package/src/bootstrap/less/media.less +66 -66
  135. package/src/bootstrap/less/mixins/alerts.less +14 -14
  136. package/src/bootstrap/less/mixins/background-variant.less +9 -9
  137. package/src/bootstrap/less/mixins/border-radius.less +18 -18
  138. package/src/bootstrap/less/mixins/buttons.less +69 -69
  139. package/src/bootstrap/less/mixins/center-block.less +7 -7
  140. package/src/bootstrap/less/mixins/clearfix.less +22 -22
  141. package/src/bootstrap/less/mixins/forms.less +90 -90
  142. package/src/bootstrap/less/mixins/gradients.less +59 -59
  143. package/src/bootstrap/less/mixins/grid-framework.less +92 -92
  144. package/src/bootstrap/less/mixins/grid.less +122 -122
  145. package/src/bootstrap/less/mixins/hide-text.less +21 -21
  146. package/src/bootstrap/less/mixins/image.less +33 -33
  147. package/src/bootstrap/less/mixins/labels.less +12 -12
  148. package/src/bootstrap/less/mixins/list-group.less +30 -30
  149. package/src/bootstrap/less/mixins/nav-divider.less +10 -10
  150. package/src/bootstrap/less/mixins/nav-vertical-align.less +9 -9
  151. package/src/bootstrap/less/mixins/opacity.less +8 -8
  152. package/src/bootstrap/less/mixins/pagination.less +24 -24
  153. package/src/bootstrap/less/mixins/panels.less +24 -24
  154. package/src/bootstrap/less/mixins/progress-bar.less +10 -10
  155. package/src/bootstrap/less/mixins/reset-filter.less +8 -8
  156. package/src/bootstrap/less/mixins/reset-text.less +18 -18
  157. package/src/bootstrap/less/mixins/resize.less +6 -6
  158. package/src/bootstrap/less/mixins/responsive-visibility.less +15 -15
  159. package/src/bootstrap/less/mixins/size.less +10 -10
  160. package/src/bootstrap/less/mixins/tab-focus.less +9 -9
  161. package/src/bootstrap/less/mixins/table-row.less +44 -44
  162. package/src/bootstrap/less/mixins/text-emphasis.less +9 -9
  163. package/src/bootstrap/less/mixins/text-overflow.less +8 -8
  164. package/src/bootstrap/less/mixins/vendor-prefixes.less +227 -227
  165. package/src/bootstrap/less/mixins.less +40 -40
  166. package/src/bootstrap/less/modals.less +151 -151
  167. package/src/bootstrap/less/navbar.less +660 -660
  168. package/src/bootstrap/less/navs.less +286 -286
  169. package/src/bootstrap/less/normalize.less +424 -424
  170. package/src/bootstrap/less/pager.less +76 -76
  171. package/src/bootstrap/less/pagination.less +89 -89
  172. package/src/bootstrap/less/panels.less +275 -275
  173. package/src/bootstrap/less/popovers.less +131 -131
  174. package/src/bootstrap/less/print.less +101 -101
  175. package/src/bootstrap/less/progress-bars.less +87 -87
  176. package/src/bootstrap/less/responsive-embed.less +35 -35
  177. package/src/bootstrap/less/responsive-utilities.less +194 -194
  178. package/src/bootstrap/less/scaffolding.less +161 -161
  179. package/src/bootstrap/less/tables.less +262 -262
  180. package/src/bootstrap/less/theme.less +291 -291
  181. package/src/bootstrap/less/thumbnails.less +36 -36
  182. package/src/bootstrap/less/tooltip.less +102 -102
  183. package/src/bootstrap/less/type.less +303 -303
  184. package/src/bootstrap/less/utilities.less +55 -55
  185. package/src/bootstrap/less/variables.less +895 -895
  186. package/src/bootstrap/less/wells.less +29 -29
  187. package/src/components/AloneLoadParams.vue +26 -26
  188. package/src/components/LoadAppdata.vue +38 -38
  189. package/src/components/LoginApp.vue +2 -2
  190. package/src/components/LoginAppNew.vue +590 -590
  191. package/src/components/LoginAppV4.vue +790 -790
  192. package/src/components/ModifyPassWord.vue +219 -219
  193. package/src/components/PhoneSellInfo.vue +148 -148
  194. package/src/components/Test.vue +14 -14
  195. package/src/plugins/GetStringData.js +18 -18
  196. package/src/plugins/LoadParams.js +24 -24
  197. package/src/plugins/validateStrongPasswordPhone.js +172 -172
  198. package/src/services/ConfigService.js +24 -24
  199. package/static/app.json +4 -4
  200. package/static/globals.txt +74 -74
  201. package/test/unit/.eslintrc +5 -5
  202. package/test/unit/TestUtil.js +35 -35
  203. package/test/unit/context.html +20 -20
  204. package/test/unit/index.js +13 -13
  205. package/test/unit/init.js +13 -13
  206. package/test/unit/karma.conf.js +50 -50
  207. package/test/unit/specs/App.spec.js +17 -17
  208. package/test/unit/specs/Test.spec.js +28 -28
  209. package/test/unit/specs/components/LoginApp.spec.js +21 -21
  210. package/test/unit/specs/sevices/ConfigService.spec.js +23 -23
  211. package/test/unit/specs/sevices/GetDBTest.spec.js +28 -28
@@ -1,790 +1,790 @@
1
- <template>
2
- <div class="loginbg" id="outheight">
3
- <!--输入框-->
4
- <div class="htmleaf-container">
5
- <div class="wrapper" :class="{'form-success': login}">
6
- <div class="container">
7
- <h3 style="color:white; margin-top: 15px">欢迎使用</h3>
8
- <p class="form" :style="{'margin-top': margintop + 'px'}">
9
- <input type="text" v-model="ename" class="usericon"/>
10
- <input :type="showpass==true?'text':'password'" v-model="password" class="psicon"/>
11
- <img :src="imageurl"
12
- style="width: 20px;margin-bottom: 5px;position: absolute;left: 62%;bottom: 43%;"
13
- alt=""
14
- @click="changepass()"/>
15
- <button type="button" id="login-button" @click.prevent="confirm()"><strong>登录</strong></button>
16
- </p>
17
- <div class="row">
18
- <img src="../assets/选中.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="showsave"
19
- @click="showoff()">
20
- <img src="../assets/未选.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="!showsave"
21
- @click="showon()">
22
- <span class="text-left font">记住密码</span>
23
- <img src="../assets/选中.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="showauto == '1'"
24
- @click="showoff1()">
25
- <img src="../assets/未选.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="showauto == '2'"
26
- @click="showon1()">
27
- <span class="text-left font">自动登录</span>
28
- <p></p>
29
- <span class="devicetext">设备码:{{ deviceIemi }}</span>
30
- </div>
31
- </div>
32
- </div>
33
- </div>
34
- <!--<load-appdata @ready="onReady"></load-appdata>-->
35
- <div style="width: 100%;height: 100%;position: fixed;top: 0px;" v-show="loaderShow">
36
- <div id="loading" class="loading">登陆中...</div>
37
- </div>
38
- <modal :show.sync="modifyPassword" backdrop="false">
39
- <header slot="modal-header" class="modal-header">
40
- </header>
41
- <article slot="modal-body" class="modal-body">
42
- <modify-pass-word :sourse="login" :weak-password="weakPassword" v-if="modifyPassword"
43
- v-on:success="success"></modify-pass-word>
44
- </article>
45
- <footer slot="modal-footer" class="modal-footer">
46
- </footer>
47
- </modal>
48
- </div>
49
- </template>
50
-
51
- <script>
52
-
53
- /**
54
- * 说明:
55
- * /rs/vue 请求获取到的配置文件有关配置项目
56
- * telephone.LoginApp.weakPassword:为true 是判断是否弱密码校验
57
- *
58
- * globle 校验参数 Device_IEMI 是否需要校验设备iemi编码
59
- *
60
- */
61
-
62
- import Vue from 'vue'
63
- import * as Util from '../Util'
64
- import JSEncrypt from 'jsencrypt'
65
- import {HttpResetClass} from 'vue-client'
66
- import { validateStrongPasswordPhone } from '../plugins/validateStrongPasswordPhone.js'
67
- //获取json配置文件
68
- let asyncReady = async function (self, url) {
69
- // 获取配置信息
70
- try {
71
- console.log('获取营收配置文件和参数【开始】')
72
- await self.$appdata.load()
73
- console.log('获取营收配置文件和参数【结束】,开始获取vue配置文件【开始】')
74
- let that = self
75
- let vueConfig={}
76
- let dir_module = []
77
- const res = await Vue.resetget(`${url}/api/af-safecheck/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
78
- if(res.data.global){
79
- self.delConfigKey(res.data)
80
- dir_module = res.data.global.dir_module
81
- vueConfig.safecheck = res.data
82
- } else {
83
- vueConfig = res.data
84
- }
85
- for(let mod in dir_module) {
86
- if (dir_module[mod].name !== 'af-safecheck') {
87
- let mod_url = `${url}/api/${dir_module[mod].name}/vue`
88
- if (!dir_module[mod].name.startsWith('af-')) {
89
- mod_url = `${url}/${dir_module[mod].name}/rs/vue`
90
- }
91
- let config = null
92
- try{
93
- config = await Vue.resetget(mod_url, {data: {}}, {resolveMsg: null, rejectMsg: null})
94
- }catch (e) {
95
- console.log('获取配置报错-先跳过', e)
96
- }
97
- // 拿到的配置有问题就跳过
98
- if(config && config.data instanceof Object){
99
- self.delConfigKey(config.data)
100
- vueConfig[dir_module[mod].name] = config.data;
101
- }
102
- }
103
- }
104
- that.$set('config', vueConfig)
105
- Vue.config2 = vueConfig
106
- // 判断是否需要弱密码校验
107
- if (self.config && self.config.telephone && self.config.telephone.LoginApp && 'undefined' != typeof self.config.telephone.LoginApp.weakPassword) {
108
- self.weakPassword = self.config.telephone.LoginApp.weakPassword
109
- Vue.weakPassword = self.config.telephone.LoginApp.weakPassword
110
- }
111
- console.log('手机端获取.json文件')
112
- console.log(JSON.stringify(self.config))
113
- return true
114
- } catch (error) {
115
- console.log(error)
116
- // 此处业务数据装载异常不做任何处理,理论上不会有任何异常
117
- self.$showMessage('登录系统: 获取配置文件失败,请检查网络后重新登陆!')
118
- return false
119
- }
120
- }
121
-
122
- //装载业务数据
123
- let asyncLoadData = async function (self, url) {
124
- try {
125
- // 读取报建本地配置文件
126
- var result = HostApp.readLocalFile('workflow_apply.json')
127
- if (result.code == 500) {
128
- console.log('不存在流程配置文件,即不使用报建app')
129
- return
130
- }
131
- var data = JSON.parse(result.data)
132
- console.log('读取报建配置文件成功,存入缓存中的data=>' + JSON.stringify(data))
133
- Vue.workflow_vue = Vue.prototype.$workflow_vue = data
134
- } catch (error) {
135
- // 此处业务数据装载异常不做任何处理,理论上不会有任何异常,只有当app版本端版本较低无readlocalfile时会异常
136
- console.log(error)
137
- }
138
- }
139
-
140
- export default {
141
- title: '登录系统',
142
- data () {
143
- return {
144
- loaderShow: false,
145
- weakPassword: false,
146
- modifyPassword: false,
147
- ename: '',
148
- login: 'login',
149
- password: '',
150
- showsave: true,
151
- showauto: '2', // 1 自动登陆 2取消自动登陆
152
- showpass: false,
153
- imageurl: require('../assets/miwen.png'),
154
- deviceIemi: '无法获取该设备码,请联系管理员',
155
- loginSafe: false,
156
- margintop: document.documentElement.clientHeight * 0.1,
157
- config: null
158
- }
159
- },
160
-
161
- ready () {
162
- if (Vue.android) {
163
- // 获取系统配置文件
164
- let users = this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-system/logic/openapi/getLiuliConfiguration`, {
165
- configName: 'webConfig'
166
- }, {resolveMsg: null, rejectMsg: null}).then(res=>{
167
- this.config = res.data
168
- })
169
- const userCache = this.$androidUtil.getPreference('login_user_cache')
170
- this.showauto = this.$androidUtil.getPreference('auto_login')
171
- this.showauto = this.showauto ? this.showauto : '2'
172
- console.log(`自动登陆标识ready:${this.showauto}`)
173
- if (userCache) {
174
- const userCacheJSON = JSON.parse(userCache.replace(/\'/g, '\"'))
175
- this.password = userCacheJSON.password
176
- this.ename = userCacheJSON.username
177
- }
178
- this.deviceIemi = this.$androidUtil.getDeviceIEMI()
179
- console.log(`手机设备码:${this.deviceIemi}`)
180
- if (this.showauto == '1' && this.password) {
181
- this.confirm()
182
- }
183
- }
184
- },
185
- methods: {
186
- success (val) {
187
- // 修改密码成功
188
- this.modifyPassword = false
189
- this.password = val
190
- },
191
- // 对资源菜单进行排序
192
- sortFunctions (val) {
193
- this.sortArr(val)
194
- val.forEach((item)=>{
195
- if(item.children && Array.isArray(item.children)){
196
- this.sortArr(item.children)
197
- }
198
- })
199
- return val
200
- },
201
- sortArr(val){
202
- val.sort((itemA, itemB)=>{
203
- if(itemA.position !== itemB.position){
204
- return itemA.position - itemB.position
205
- }else{
206
- return itemA.id - itemB.id
207
- }
208
- })
209
- },
210
- // 记住密码选中/未选中
211
- showoff () {
212
- this.showsave = false
213
- },
214
- showon () {
215
- this.showsave = true
216
- },
217
- showoff1 () {
218
- this.showauto = '2'
219
- },
220
- showon1 () {
221
- this.showauto = '1'
222
- },
223
- changepass () {
224
- this.showpass = this.showpass ? false : true
225
- if (this.showpass) {
226
- this.imageurl = require('../assets/mingwen.png')
227
- } else {
228
- this.imageurl = require('../assets/miwen.png')
229
- }
230
- },
231
- async confirm () {
232
- this.loaderShow = true
233
- console.log('Vue.android:' + Vue.android)
234
- Vue.dataUrl = this.$androidUtil.getProxyUrl() + '/'
235
- let loginData = {}
236
- try {
237
- let ret = {}
238
- try {
239
- ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-auth/login`, {
240
- username: this.ename, password: this.password,
241
- resourceName: '手机服务'
242
- }, {
243
- resolveMsg: null,
244
- rejectMsg: null,
245
- headerConfig: {'Content-type': 'application/json'}
246
- })
247
- console.log(ret, '==')
248
- if (ret.data) {
249
- if (ret.data.resources.data && ret.data.resources.data.id) {
250
- loginData = ret.data.resources.data
251
- } else {
252
- loginData = ret.data.resources
253
- }
254
- this.$androidUtil.setPreference('siteId', loginData.f_extend1 || '')
255
- this.$androidUtil.setPreference('flatId', loginData.f_extend2 || '')
256
- this.$androidUtil.setPreference('name', loginData.name || '')
257
- this.$androidUtil.setPreference('ename', loginData.ename || '')
258
- } else {
259
- throw {status: ret.data.code, message: ret.data.msg}
260
- }
261
- } catch (e) {
262
- if (Vue.android) {
263
- this.loaderShow = false
264
- this.$showMessage(e.message ? e.message : '登录失败!用户名或密码错误!')
265
- }
266
- return
267
- }
268
-
269
- // 设置登录人
270
- Vue.user = Util.f = loginData
271
-
272
- // 对资源菜单进行排序
273
- try{
274
- let viewDetails = await Vue.resetpost(`${this.$androidUtil.getProxyUrl()}/rs/search`, {
275
- source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
276
- userid: Vue.user.id
277
- }, {resolveMsg: null, rejectMsg: null})
278
- const rithtList = viewDetails.data
279
- Vue.user.r = []
280
- rithtList.forEach(x => Vue.user.r.push(x.name))
281
- }catch (e) {
282
- console.log('资源排序失败!暂时先不影响登录')
283
- }
284
- // 功能排序
285
- Vue.functions = this.sortFunctions(loginData.functions)
286
- let userStr
287
- if (Vue.android) {
288
- console.log(`Device_IEMI:${this.$androidUtil.getPreference('Device_IEMI')}`)
289
- // 判断是否需要验证 设备码
290
- if (this.$androidUtil.getPreference('Device_IEMI')) {
291
- console.log(`手机设备码:${this.deviceIemi}`)
292
- let result = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
293
- data: {
294
- items: '*',
295
- tablename: 't_equipment',
296
- orderitem: 'id desc',
297
- condition: `f_terminal_number = '${this.deviceIemi}' and f_state = '正常'`
298
- }
299
- }, {resolveMsg: null, rejectMsg: null})
300
- console.log(`检测设备码存在是否:${result.data.length}`)
301
- if (result.data.length == 0) {
302
- HostApp.alert('设备码未绑定,请联系管理员!')
303
- return
304
- }
305
- }
306
- if (this.showsave) {
307
- userStr = `{'username':'${this.ename}','password':'${this.password}'}`
308
- } else {
309
- userStr = `{'username':'${this.ename}','password':''}`
310
- }
311
- await new HttpResetClass().load('post',`${this.$androidUtil.getProxyUrl()}/api/af-system/logic/openapi/getLiuliConfiguration`, {
312
- configName: 'webConfig'
313
- }, {resolveMsg: null, rejectMsg: null}).then(res=>{
314
- this.config = res.data
315
- })
316
- console.log(this.showauto)
317
- this.$androidUtil.setPreference('login_user_cache', userStr)
318
- this.$androidUtil.setPreference('f_repairman_id', Util.f.id)
319
- this.$androidUtil.setPreference('f_repairman_name', Util.f.name)
320
- this.$androidUtil.setPreference('f_orgid', Util.f.orgid)
321
- this.$androidUtil.setPreference('f_role_name', Util.f.f_role_name || '')
322
- this.$androidUtil.setPreference('access_token', ret.data.access_token)
323
- if(this.config && this.config.setting.requestEncrypt){
324
- this.$androidUtil.setPreference('v4-session-key', this.RSADecrypt(ret.data.session))
325
- }else{
326
- this.$androidUtil.setPreference('v4-session-key', "")
327
- }
328
- console.log('自动登陆标识' + Util.f.f_role_name)
329
- console.log(this.showauto)
330
- this.$androidUtil.setPreference('auto_login', this.showauto)
331
- }
332
- Vue.$login = Vue.prototype.$login = {
333
- jwt: loginData.id,
334
- jwtNew: ret.data.access_token,
335
- "v4-session-key": this.config && this.config.setting.requestEncrypt ? this.RSADecrypt(ret.data.session): null,
336
- toStandardDateString () {
337
- let dt = new Date()
338
- let month = dt.getMonth() + 1
339
- let date = dt.getDate()
340
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
341
- }, toStandardTimeString () {
342
- let dt = new Date()
343
- let month = dt.getMonth() + 1
344
- let date = dt.getDate()
345
- let hour = dt.getHours()
346
- let min = dt.getMinutes()
347
- let sec = dt.getSeconds()
348
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
349
- + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
350
- }
351
- }
352
- // 获取参数
353
- console.log('获取参数system以及安检参数')
354
- const flag = await asyncReady(this, this.$androidUtil.getProxyUrl())
355
- if (!flag) {
356
- this.loaderShow = false
357
- console.log('获取参数异常')
358
- return
359
- }
360
- console.log('获取参数结束')
361
- this.loaderShow = false
362
- // 弱口令验证
363
- if (this.weakPassword) {
364
- const pwdResult = validateStrongPasswordPhone(this.password)
365
- if (!pwdResult.isValid) {
366
- await this.$showMessage('登录系统: 此账户的密码过于简单,' + (pwdResult.errors[0] || '请修改密码后重新登陆!!!'), ['confirm'])
367
- this.modifyPassword = true
368
- return
369
- }
370
- }
371
- this.$goto('nav-bottom')
372
- } catch (e) {
373
- if (Vue.android) {
374
- this.loaderShow = false
375
- }
376
- console.error('登录异常,LoginApp的confirm函数错误', e)
377
- this.$showMessage('登陆失败!,')
378
- }
379
- },
380
- RSADecrypt(encryptedData) {
381
- try {
382
- const pk = this.$androidUtil.getPreference('v4PrivateKey')
383
- const decryptor = new JSEncrypt();
384
- decryptor.setPrivateKey(pk);
385
- const decrypted = decryptor.decrypt(encryptedData);
386
-
387
- if (!decrypted) {
388
- throw new Error('解密失败:空结果');
389
- }
390
- return decrypted;
391
- } catch (error) {
392
- console.error('RSA解密错误:', error);
393
- throw new Error('RSA解密失败,请检查私钥格式');
394
- }
395
- },
396
-
397
- delConfigKey(obj){
398
- // 从琉璃中获取的配置中会包含 $开头的一些额外描述新的key。为了兼容v3的代码逻辑在此函数中去掉
399
- Object.keys(obj).forEach(key =>{
400
- Object.keys(obj[key]).forEach(col => {
401
- // 检查键是否以$开头
402
- if (col.startsWith('$')) {
403
- // 使用delete操作符删除键
404
- delete obj[key][col];
405
- }
406
- })
407
- })
408
- }
409
- },
410
- watch: {
411
- 'config' (val) {
412
- Vue.config = val
413
- }
414
- }
415
- }
416
- </script>
417
- <style scoped="">
418
- .devicetext {
419
- font: 13px PingFang-SC-Medium;
420
- position: fixed;
421
- width: 100%;
422
- bottom: 13px;
423
- transform: translate(-50%, -50%);
424
- }
425
-
426
- /*输入框样式*/
427
- /*@import url(http://fonts.useso.com/css?family=Source+Sans+Pro:200,300);*/
428
- * {
429
- box-sizing: border-box;
430
- margin: 0;
431
- padding: 0;
432
- font-weight: 300;
433
- }
434
-
435
- .loginbg {
436
- font-family: 'Source Sans Pro', sans-serif;
437
- color: white;
438
- font-weight: 300;
439
- }
440
-
441
- .loginbg ::-webkit-input-placeholder {
442
- /* WebKit browsers */
443
- font-family: 'Source Sans Pro', sans-serif;
444
- color: white;
445
- font-weight: 300;
446
- }
447
-
448
- .loginbg :-moz-placeholder {
449
- /* Mozilla Firefox 4 to 18 */
450
- font-family: 'Source Sans Pro', sans-serif;
451
- color: white;
452
- opacity: 1;
453
- font-weight: 300;
454
- }
455
-
456
- .loginbg ::-moz-placeholder {
457
- /* Mozilla Firefox 19+ */
458
- font-family: 'Source Sans Pro', sans-serif;
459
- color: white;
460
- opacity: 1;
461
- font-weight: 300;
462
- }
463
-
464
- .loginbg :-ms-input-placeholder {
465
- /* Internet Explorer 10+ */
466
- font-family: 'Source Sans Pro', sans-serif;
467
- color: white;
468
- font-weight: 300;
469
- }
470
-
471
- .wrapper {
472
- /*background: #2D83BA;
473
- background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
474
- background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
475
- opacity: 0.8;*/
476
- /*position: absolute;*/
477
- /*top: 50%;
478
- right: 10%;
479
- width: 40%;
480
- height: 350px;
481
- margin-top: -150px;*/
482
- overflow: hidden;
483
- }
484
-
485
- .wrapper.form-success .container h3 {
486
- -webkit-transform: translateY(85px);
487
- -ms-transform: translateY(85px);
488
- transform: translateY(85px);
489
- }
490
-
491
- .container {
492
- /*max-width: 350px;*/
493
- margin: 0 auto;
494
- /*padding: 30px 100px 50px 100px;
495
- height: 350px;*/
496
- text-align: center;
497
- /*以下增加*/
498
- /*background: #2D83BA;
499
- background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
500
- background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);*/
501
- opacity: 0.8;
502
- }
503
-
504
- .container h3 {
505
- font-size: 40px;
506
- -webkit-transition-duration: 1s;
507
- transition-duration: 1s;
508
- -webkit-transition-timing-function: ease-in-out;
509
- transition-timing-function: ease-in-out;
510
- font-weight: 200;
511
- }
512
-
513
- .form {
514
- padding: 20px 0;
515
- /*margin-top: 15%;*/
516
- position: relative;
517
- z-index: 2;
518
- }
519
-
520
- .form input {
521
- -webkit-appearance: none;
522
- -moz-appearance: none;
523
- appearance: none;
524
- outline: 0;
525
- border: 1px solid #50ABE6;
526
- background-color: #50ABE6;
527
- width: 250px;
528
- border-radius: 3px;
529
- padding: 10px 15px;
530
- margin: 0 auto 10px auto;
531
- display: block;
532
- text-align: center;
533
- font-size: 18px;
534
- color: white;
535
- -webkit-transition-duration: 0.25s;
536
- transition-duration: 0.25s;
537
- font-weight: 300;
538
- }
539
-
540
- .form input:hover {
541
- background-color: rgba(255, 255, 255, 0.4);
542
- }
543
-
544
- .form input:focus {
545
- background-color: white;
546
- width: 300px;
547
- color: #53e3a6;
548
- }
549
-
550
- .usericon {
551
- background-image: url(../assets/usericon.png);
552
- background-repeat: no-repeat;
553
- background-size: 30px;
554
- background-position-x: 8px;
555
- background-position-y: 8px;
556
- }
557
-
558
- .psicon {
559
- background-image: url(../assets/psicon.png);
560
- background-repeat: no-repeat;
561
- background-size: 30px;
562
- background-position-x: 8px;
563
- background-position-y: 8px;
564
- }
565
-
566
- .form button {
567
- -webkit-appearance: none;
568
- -moz-appearance: none;
569
- appearance: none;
570
- outline: 0;
571
- background-color: white;
572
- border: 0;
573
- padding: 10px 15px;
574
- color: #253830;
575
- border-radius: 3px;
576
- width: 250px;
577
- cursor: pointer;
578
- font-size: 18px;
579
- -webkit-transition-duration: 0.25s;
580
- transition-duration: 0.25s;
581
- }
582
-
583
- .form button:hover {
584
- background-color: #f5f7f9;
585
- }
586
-
587
- /*注册字体样式*/
588
- .form span {
589
- color: #fff;
590
- display: table-footer-group;
591
- position: absolute;
592
- right: 10px;
593
- margin-top: 10px;
594
- cursor: pointer;
595
- }
596
-
597
- .logotitle {
598
- color: #fff;
599
- position: absolute;
600
- top: 50px;
601
- left: 50px;
602
- font-size: 50px;
603
- }
604
-
605
- /*注册模态框界面样式*/
606
- .modifystyle {
607
- background: #FCFEEE;
608
- }
609
-
610
- .modifystyle div {
611
- height: auto;
612
- margin-bottom: 15px;
613
- /*text-align: center;*/
614
- /*margin-left: 20%;*/
615
- }
616
-
617
- /*bootstrap字体图标要手动调整,所以使用字体图标的span必须紧跟在input后面,负责会错位*/
618
- .modifystyle div input + span {
619
- top: 0 !important;
620
- right: 32%;
621
- }
622
-
623
- .modifystyle span {
624
- color: red;
625
- }
626
-
627
- /* 通告区内容 */
628
- .notice-board {
629
- height: auto;
630
- position: absolute;
631
- top: 50%;
632
- margin-top: -150px;
633
- margin-left: 100px;
634
- color: #fff;
635
- }
636
-
637
- /*修改密码底部按钮部分样式*/
638
- .footerbtn {
639
- text-align: center;
640
- padding: 15px;
641
- }
642
-
643
- .footerbtn button {
644
- width: 100px;
645
- margin-left: 20px;
646
- }
647
-
648
- .bg-bubbles {
649
- position: absolute;
650
- top: 0;
651
- left: 0;
652
- width: 100%;
653
- height: 100%;
654
- z-index: 1;
655
- }
656
-
657
- .bg-bubbles li {
658
- position: absolute;
659
- list-style: none;
660
- display: block;
661
- width: 40px;
662
- height: 40px;
663
- background-color: rgba(255, 255, 255, 0.15);
664
- bottom: -160px;
665
- -webkit-animation: square 25s infinite;
666
- animation: square 25s infinite;
667
- -webkit-transition-timing-function: linear;
668
- transition-timing-function: linear;
669
- }
670
-
671
- .bg-bubbles li:nth-child(1) {
672
- left: 10%;
673
- }
674
-
675
- .bg-bubbles li:nth-child(2) {
676
- left: 20%;
677
- width: 80px;
678
- height: 80px;
679
- -webkit-animation-delay: 2s;
680
- animation-delay: 2s;
681
- -webkit-animation-duration: 17s;
682
- animation-duration: 17s;
683
- }
684
-
685
- .bg-bubbles li:nth-child(3) {
686
- left: 25%;
687
- -webkit-animation-delay: 4s;
688
- animation-delay: 4s;
689
- }
690
-
691
- .bg-bubbles li:nth-child(4) {
692
- left: 40%;
693
- width: 60px;
694
- height: 60px;
695
- -webkit-animation-duration: 22s;
696
- animation-duration: 22s;
697
- background-color: rgba(255, 255, 255, 0.25);
698
- }
699
-
700
- .bg-bubbles li:nth-child(5) {
701
- left: 70%;
702
- }
703
-
704
- .bg-bubbles li:nth-child(6) {
705
- left: 80%;
706
- width: 120px;
707
- height: 120px;
708
- -webkit-animation-delay: 3s;
709
- animation-delay: 3s;
710
- background-color: rgba(255, 255, 255, 0.2);
711
- }
712
-
713
- .bg-bubbles li:nth-child(7) {
714
- left: 32%;
715
- width: 160px;
716
- height: 160px;
717
- -webkit-animation-delay: 7s;
718
- animation-delay: 7s;
719
- }
720
-
721
- .bg-bubbles li:nth-child(8) {
722
- left: 55%;
723
- width: 20px;
724
- height: 20px;
725
- -webkit-animation-delay: 15s;
726
- animation-delay: 15s;
727
- -webkit-animation-duration: 40s;
728
- animation-duration: 40s;
729
- }
730
-
731
- .bg-bubbles li:nth-child(9) {
732
- left: 25%;
733
- width: 10px;
734
- height: 10px;
735
- -webkit-animation-delay: 2s;
736
- animation-delay: 2s;
737
- -webkit-animation-duration: 40s;
738
- animation-duration: 40s;
739
- background-color: rgba(255, 255, 255, 0.3);
740
- }
741
-
742
- .bg-bubbles li:nth-child(10) {
743
- left: 90%;
744
- width: 160px;
745
- height: 160px;
746
- -webkit-animation-delay: 11s;
747
- animation-delay: 11s;
748
- }
749
-
750
- @-webkit-keyframes square {
751
- 0% {
752
- -webkit-transform: translateY(0);
753
- transform: translateY(0);
754
- }
755
- 100% {
756
- -webkit-transform: translateY(-700px) rotate(600deg);
757
- transform: translateY(-700px) rotate(600deg);
758
- }
759
- }
760
-
761
- @keyframes square {
762
- 0% {
763
- -webkit-transform: translateY(0);
764
- transform: translateY(0);
765
- }
766
- 100% {
767
- -webkit-transform: translateY(-700px) rotate(600deg);
768
- transform: translateY(-700px) rotate(600deg);
769
- }
770
- }
771
-
772
- .loading {
773
- width: 36%;
774
- height: 7%;
775
- position: absolute;
776
- top: 30%;
777
- left: 32%;
778
- line-height: 56px;
779
- color: #fff;
780
- padding-left: 60px;
781
- font-size: 15px;
782
- background: #000 url(../assets/loging.gif) no-repeat 10px 50%;
783
- opacity: 0.7;
784
- z-index: 9999;
785
- -moz-border-radius: 20px;
786
- -webkit-border-radius: 20px;
787
- border-radius: 20px;
788
- filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);
789
- }
790
- </style>
1
+ <template>
2
+ <div class="loginbg" id="outheight">
3
+ <!--输入框-->
4
+ <div class="htmleaf-container">
5
+ <div class="wrapper" :class="{'form-success': login}">
6
+ <div class="container">
7
+ <h3 style="color:white; margin-top: 15px">欢迎使用</h3>
8
+ <p class="form" :style="{'margin-top': margintop + 'px'}">
9
+ <input type="text" v-model="ename" class="usericon"/>
10
+ <input :type="showpass==true?'text':'password'" v-model="password" class="psicon"/>
11
+ <img :src="imageurl"
12
+ style="width: 20px;margin-bottom: 5px;position: absolute;left: 62%;bottom: 43%;"
13
+ alt=""
14
+ @click="changepass()"/>
15
+ <button type="button" id="login-button" @click.prevent="confirm()"><strong>登录</strong></button>
16
+ </p>
17
+ <div class="row">
18
+ <img src="../assets/选中.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="showsave"
19
+ @click="showoff()">
20
+ <img src="../assets/未选.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="!showsave"
21
+ @click="showon()">
22
+ <span class="text-left font">记住密码</span>
23
+ <img src="../assets/选中.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="showauto == '1'"
24
+ @click="showoff1()">
25
+ <img src="../assets/未选.png" style="width: 20px;margin-bottom: 5px" alt="" v-if="showauto == '2'"
26
+ @click="showon1()">
27
+ <span class="text-left font">自动登录</span>
28
+ <p></p>
29
+ <span class="devicetext">设备码:{{ deviceIemi }}</span>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <!--<load-appdata @ready="onReady"></load-appdata>-->
35
+ <div style="width: 100%;height: 100%;position: fixed;top: 0px;" v-show="loaderShow">
36
+ <div id="loading" class="loading">登陆中...</div>
37
+ </div>
38
+ <modal :show.sync="modifyPassword" backdrop="false">
39
+ <header slot="modal-header" class="modal-header">
40
+ </header>
41
+ <article slot="modal-body" class="modal-body">
42
+ <modify-pass-word :sourse="login" :weak-password="weakPassword" v-if="modifyPassword"
43
+ v-on:success="success"></modify-pass-word>
44
+ </article>
45
+ <footer slot="modal-footer" class="modal-footer">
46
+ </footer>
47
+ </modal>
48
+ </div>
49
+ </template>
50
+
51
+ <script>
52
+
53
+ /**
54
+ * 说明:
55
+ * /rs/vue 请求获取到的配置文件有关配置项目
56
+ * telephone.LoginApp.weakPassword:为true 是判断是否弱密码校验
57
+ *
58
+ * globle 校验参数 Device_IEMI 是否需要校验设备iemi编码
59
+ *
60
+ */
61
+
62
+ import Vue from 'vue'
63
+ import * as Util from '../Util'
64
+ import JSEncrypt from 'jsencrypt'
65
+ import {HttpResetClass} from 'vue-client'
66
+ import { validateStrongPasswordPhone } from '../plugins/validateStrongPasswordPhone.js'
67
+ //获取json配置文件
68
+ let asyncReady = async function (self, url) {
69
+ // 获取配置信息
70
+ try {
71
+ console.log('获取营收配置文件和参数【开始】')
72
+ await self.$appdata.load()
73
+ console.log('获取营收配置文件和参数【结束】,开始获取vue配置文件【开始】')
74
+ let that = self
75
+ let vueConfig={}
76
+ let dir_module = []
77
+ const res = await Vue.resetget(`${url}/api/af-safecheck/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
78
+ if(res.data.global){
79
+ self.delConfigKey(res.data)
80
+ dir_module = res.data.global.dir_module
81
+ vueConfig.safecheck = res.data
82
+ } else {
83
+ vueConfig = res.data
84
+ }
85
+ for(let mod in dir_module) {
86
+ if (dir_module[mod].name !== 'af-safecheck') {
87
+ let mod_url = `${url}/api/${dir_module[mod].name}/vue`
88
+ if (!dir_module[mod].name.startsWith('af-')) {
89
+ mod_url = `${url}/${dir_module[mod].name}/rs/vue`
90
+ }
91
+ let config = null
92
+ try{
93
+ config = await Vue.resetget(mod_url, {data: {}}, {resolveMsg: null, rejectMsg: null})
94
+ }catch (e) {
95
+ console.log('获取配置报错-先跳过', e)
96
+ }
97
+ // 拿到的配置有问题就跳过
98
+ if(config && config.data instanceof Object){
99
+ self.delConfigKey(config.data)
100
+ vueConfig[dir_module[mod].name] = config.data;
101
+ }
102
+ }
103
+ }
104
+ that.$set('config', vueConfig)
105
+ Vue.config2 = vueConfig
106
+ // 判断是否需要弱密码校验
107
+ if (self.config && self.config.telephone && self.config.telephone.LoginApp && 'undefined' != typeof self.config.telephone.LoginApp.weakPassword) {
108
+ self.weakPassword = self.config.telephone.LoginApp.weakPassword
109
+ Vue.weakPassword = self.config.telephone.LoginApp.weakPassword
110
+ }
111
+ console.log('手机端获取.json文件')
112
+ console.log(JSON.stringify(self.config))
113
+ return true
114
+ } catch (error) {
115
+ console.log(error)
116
+ // 此处业务数据装载异常不做任何处理,理论上不会有任何异常
117
+ self.$showMessage('登录系统: 获取配置文件失败,请检查网络后重新登陆!')
118
+ return false
119
+ }
120
+ }
121
+
122
+ //装载业务数据
123
+ let asyncLoadData = async function (self, url) {
124
+ try {
125
+ // 读取报建本地配置文件
126
+ var result = HostApp.readLocalFile('workflow_apply.json')
127
+ if (result.code == 500) {
128
+ console.log('不存在流程配置文件,即不使用报建app')
129
+ return
130
+ }
131
+ var data = JSON.parse(result.data)
132
+ console.log('读取报建配置文件成功,存入缓存中的data=>' + JSON.stringify(data))
133
+ Vue.workflow_vue = Vue.prototype.$workflow_vue = data
134
+ } catch (error) {
135
+ // 此处业务数据装载异常不做任何处理,理论上不会有任何异常,只有当app版本端版本较低无readlocalfile时会异常
136
+ console.log(error)
137
+ }
138
+ }
139
+
140
+ export default {
141
+ title: '登录系统',
142
+ data () {
143
+ return {
144
+ loaderShow: false,
145
+ weakPassword: false,
146
+ modifyPassword: false,
147
+ ename: '',
148
+ login: 'login',
149
+ password: '',
150
+ showsave: true,
151
+ showauto: '2', // 1 自动登陆 2取消自动登陆
152
+ showpass: false,
153
+ imageurl: require('../assets/miwen.png'),
154
+ deviceIemi: '无法获取该设备码,请联系管理员',
155
+ loginSafe: false,
156
+ margintop: document.documentElement.clientHeight * 0.1,
157
+ config: null
158
+ }
159
+ },
160
+
161
+ ready () {
162
+ if (Vue.android) {
163
+ // 获取系统配置文件
164
+ let users = this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-system/logic/openapi/getLiuliConfiguration`, {
165
+ configName: 'webConfig'
166
+ }, {resolveMsg: null, rejectMsg: null}).then(res=>{
167
+ this.config = res.data
168
+ })
169
+ const userCache = this.$androidUtil.getPreference('login_user_cache')
170
+ this.showauto = this.$androidUtil.getPreference('auto_login')
171
+ this.showauto = this.showauto ? this.showauto : '2'
172
+ console.log(`自动登陆标识ready:${this.showauto}`)
173
+ if (userCache) {
174
+ const userCacheJSON = JSON.parse(userCache.replace(/\'/g, '\"'))
175
+ this.password = userCacheJSON.password
176
+ this.ename = userCacheJSON.username
177
+ }
178
+ this.deviceIemi = this.$androidUtil.getDeviceIEMI()
179
+ console.log(`手机设备码:${this.deviceIemi}`)
180
+ if (this.showauto == '1' && this.password) {
181
+ this.confirm()
182
+ }
183
+ }
184
+ },
185
+ methods: {
186
+ success (val) {
187
+ // 修改密码成功
188
+ this.modifyPassword = false
189
+ this.password = val
190
+ },
191
+ // 对资源菜单进行排序
192
+ sortFunctions (val) {
193
+ this.sortArr(val)
194
+ val.forEach((item)=>{
195
+ if(item.children && Array.isArray(item.children)){
196
+ this.sortArr(item.children)
197
+ }
198
+ })
199
+ return val
200
+ },
201
+ sortArr(val){
202
+ val.sort((itemA, itemB)=>{
203
+ if(itemA.position !== itemB.position){
204
+ return itemA.position - itemB.position
205
+ }else{
206
+ return itemA.id - itemB.id
207
+ }
208
+ })
209
+ },
210
+ // 记住密码选中/未选中
211
+ showoff () {
212
+ this.showsave = false
213
+ },
214
+ showon () {
215
+ this.showsave = true
216
+ },
217
+ showoff1 () {
218
+ this.showauto = '2'
219
+ },
220
+ showon1 () {
221
+ this.showauto = '1'
222
+ },
223
+ changepass () {
224
+ this.showpass = this.showpass ? false : true
225
+ if (this.showpass) {
226
+ this.imageurl = require('../assets/mingwen.png')
227
+ } else {
228
+ this.imageurl = require('../assets/miwen.png')
229
+ }
230
+ },
231
+ async confirm () {
232
+ this.loaderShow = true
233
+ console.log('Vue.android:' + Vue.android)
234
+ Vue.dataUrl = this.$androidUtil.getProxyUrl() + '/'
235
+ let loginData = {}
236
+ try {
237
+ let ret = {}
238
+ try {
239
+ ret = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/api/af-auth/login`, {
240
+ username: this.ename, password: this.password,
241
+ resourceName: '手机服务'
242
+ }, {
243
+ resolveMsg: null,
244
+ rejectMsg: null,
245
+ headerConfig: {'Content-type': 'application/json'}
246
+ })
247
+ console.log(ret, '==')
248
+ if (ret.data) {
249
+ if (ret.data.resources.data && ret.data.resources.data.id) {
250
+ loginData = ret.data.resources.data
251
+ } else {
252
+ loginData = ret.data.resources
253
+ }
254
+ this.$androidUtil.setPreference('siteId', loginData.f_extend1 || '')
255
+ this.$androidUtil.setPreference('flatId', loginData.f_extend2 || '')
256
+ this.$androidUtil.setPreference('name', loginData.name || '')
257
+ this.$androidUtil.setPreference('ename', loginData.ename || '')
258
+ } else {
259
+ throw {status: ret.data.code, message: ret.data.msg}
260
+ }
261
+ } catch (e) {
262
+ if (Vue.android) {
263
+ this.loaderShow = false
264
+ this.$showMessage(e.message ? e.message : '登录失败!用户名或密码错误!')
265
+ }
266
+ return
267
+ }
268
+
269
+ // 设置登录人
270
+ Vue.user = Util.f = loginData
271
+
272
+ // 对资源菜单进行排序
273
+ try{
274
+ let viewDetails = await Vue.resetpost(`${this.$androidUtil.getProxyUrl()}/rs/search`, {
275
+ source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
276
+ userid: Vue.user.id
277
+ }, {resolveMsg: null, rejectMsg: null})
278
+ const rithtList = viewDetails.data
279
+ Vue.user.r = []
280
+ rithtList.forEach(x => Vue.user.r.push(x.name))
281
+ }catch (e) {
282
+ console.log('资源排序失败!暂时先不影响登录')
283
+ }
284
+ // 功能排序
285
+ Vue.functions = this.sortFunctions(loginData.functions)
286
+ let userStr
287
+ if (Vue.android) {
288
+ console.log(`Device_IEMI:${this.$androidUtil.getPreference('Device_IEMI')}`)
289
+ // 判断是否需要验证 设备码
290
+ if (this.$androidUtil.getPreference('Device_IEMI')) {
291
+ console.log(`手机设备码:${this.deviceIemi}`)
292
+ let result = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/tel_singleTable_OrderBy`, {
293
+ data: {
294
+ items: '*',
295
+ tablename: 't_equipment',
296
+ orderitem: 'id desc',
297
+ condition: `f_terminal_number = '${this.deviceIemi}' and f_state = '正常'`
298
+ }
299
+ }, {resolveMsg: null, rejectMsg: null})
300
+ console.log(`检测设备码存在是否:${result.data.length}`)
301
+ if (result.data.length == 0) {
302
+ HostApp.alert('设备码未绑定,请联系管理员!')
303
+ return
304
+ }
305
+ }
306
+ if (this.showsave) {
307
+ userStr = `{'username':'${this.ename}','password':'${this.password}'}`
308
+ } else {
309
+ userStr = `{'username':'${this.ename}','password':''}`
310
+ }
311
+ await new HttpResetClass().load('post',`${this.$androidUtil.getProxyUrl()}/api/af-system/logic/openapi/getLiuliConfiguration`, {
312
+ configName: 'webConfig'
313
+ }, {resolveMsg: null, rejectMsg: null}).then(res=>{
314
+ this.config = res.data
315
+ })
316
+ console.log(this.showauto)
317
+ this.$androidUtil.setPreference('login_user_cache', userStr)
318
+ this.$androidUtil.setPreference('f_repairman_id', Util.f.id)
319
+ this.$androidUtil.setPreference('f_repairman_name', Util.f.name)
320
+ this.$androidUtil.setPreference('f_orgid', Util.f.orgid)
321
+ this.$androidUtil.setPreference('f_role_name', Util.f.f_role_name || '')
322
+ this.$androidUtil.setPreference('access_token', ret.data.access_token)
323
+ if(this.config && this.config.setting.requestEncrypt){
324
+ this.$androidUtil.setPreference('v4-session-key', this.RSADecrypt(ret.data.session))
325
+ }else{
326
+ this.$androidUtil.setPreference('v4-session-key', "")
327
+ }
328
+ console.log('自动登陆标识' + Util.f.f_role_name)
329
+ console.log(this.showauto)
330
+ this.$androidUtil.setPreference('auto_login', this.showauto)
331
+ }
332
+ Vue.$login = Vue.prototype.$login = {
333
+ jwt: loginData.id,
334
+ jwtNew: ret.data.access_token,
335
+ "v4-session-key": this.config && this.config.setting.requestEncrypt ? this.RSADecrypt(ret.data.session): null,
336
+ toStandardDateString () {
337
+ let dt = new Date()
338
+ let month = dt.getMonth() + 1
339
+ let date = dt.getDate()
340
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
341
+ }, toStandardTimeString () {
342
+ let dt = new Date()
343
+ let month = dt.getMonth() + 1
344
+ let date = dt.getDate()
345
+ let hour = dt.getHours()
346
+ let min = dt.getMinutes()
347
+ let sec = dt.getSeconds()
348
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
349
+ + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
350
+ }
351
+ }
352
+ // 获取参数
353
+ console.log('获取参数system以及安检参数')
354
+ const flag = await asyncReady(this, this.$androidUtil.getProxyUrl())
355
+ if (!flag) {
356
+ this.loaderShow = false
357
+ console.log('获取参数异常')
358
+ return
359
+ }
360
+ console.log('获取参数结束')
361
+ this.loaderShow = false
362
+ // 弱口令验证
363
+ if (this.weakPassword) {
364
+ const pwdResult = validateStrongPasswordPhone(this.password)
365
+ if (!pwdResult.isValid) {
366
+ await this.$showMessage('登录系统: 此账户的密码过于简单,' + (pwdResult.errors[0] || '请修改密码后重新登陆!!!'), ['confirm'])
367
+ this.modifyPassword = true
368
+ return
369
+ }
370
+ }
371
+ this.$goto('nav-bottom')
372
+ } catch (e) {
373
+ if (Vue.android) {
374
+ this.loaderShow = false
375
+ }
376
+ console.error('登录异常,LoginApp的confirm函数错误', e)
377
+ this.$showMessage('登陆失败!,')
378
+ }
379
+ },
380
+ RSADecrypt(encryptedData) {
381
+ try {
382
+ const pk = this.$androidUtil.getPreference('v4PrivateKey')
383
+ const decryptor = new JSEncrypt();
384
+ decryptor.setPrivateKey(pk);
385
+ const decrypted = decryptor.decrypt(encryptedData);
386
+
387
+ if (!decrypted) {
388
+ throw new Error('解密失败:空结果');
389
+ }
390
+ return decrypted;
391
+ } catch (error) {
392
+ console.error('RSA解密错误:', error);
393
+ throw new Error('RSA解密失败,请检查私钥格式');
394
+ }
395
+ },
396
+
397
+ delConfigKey(obj){
398
+ // 从琉璃中获取的配置中会包含 $开头的一些额外描述新的key。为了兼容v3的代码逻辑在此函数中去掉
399
+ Object.keys(obj).forEach(key =>{
400
+ Object.keys(obj[key]).forEach(col => {
401
+ // 检查键是否以$开头
402
+ if (col.startsWith('$')) {
403
+ // 使用delete操作符删除键
404
+ delete obj[key][col];
405
+ }
406
+ })
407
+ })
408
+ }
409
+ },
410
+ watch: {
411
+ 'config' (val) {
412
+ Vue.config = val
413
+ }
414
+ }
415
+ }
416
+ </script>
417
+ <style scoped="">
418
+ .devicetext {
419
+ font: 13px PingFang-SC-Medium;
420
+ position: fixed;
421
+ width: 100%;
422
+ bottom: 13px;
423
+ transform: translate(-50%, -50%);
424
+ }
425
+
426
+ /*输入框样式*/
427
+ /*@import url(http://fonts.useso.com/css?family=Source+Sans+Pro:200,300);*/
428
+ * {
429
+ box-sizing: border-box;
430
+ margin: 0;
431
+ padding: 0;
432
+ font-weight: 300;
433
+ }
434
+
435
+ .loginbg {
436
+ font-family: 'Source Sans Pro', sans-serif;
437
+ color: white;
438
+ font-weight: 300;
439
+ }
440
+
441
+ .loginbg ::-webkit-input-placeholder {
442
+ /* WebKit browsers */
443
+ font-family: 'Source Sans Pro', sans-serif;
444
+ color: white;
445
+ font-weight: 300;
446
+ }
447
+
448
+ .loginbg :-moz-placeholder {
449
+ /* Mozilla Firefox 4 to 18 */
450
+ font-family: 'Source Sans Pro', sans-serif;
451
+ color: white;
452
+ opacity: 1;
453
+ font-weight: 300;
454
+ }
455
+
456
+ .loginbg ::-moz-placeholder {
457
+ /* Mozilla Firefox 19+ */
458
+ font-family: 'Source Sans Pro', sans-serif;
459
+ color: white;
460
+ opacity: 1;
461
+ font-weight: 300;
462
+ }
463
+
464
+ .loginbg :-ms-input-placeholder {
465
+ /* Internet Explorer 10+ */
466
+ font-family: 'Source Sans Pro', sans-serif;
467
+ color: white;
468
+ font-weight: 300;
469
+ }
470
+
471
+ .wrapper {
472
+ /*background: #2D83BA;
473
+ background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
474
+ background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
475
+ opacity: 0.8;*/
476
+ /*position: absolute;*/
477
+ /*top: 50%;
478
+ right: 10%;
479
+ width: 40%;
480
+ height: 350px;
481
+ margin-top: -150px;*/
482
+ overflow: hidden;
483
+ }
484
+
485
+ .wrapper.form-success .container h3 {
486
+ -webkit-transform: translateY(85px);
487
+ -ms-transform: translateY(85px);
488
+ transform: translateY(85px);
489
+ }
490
+
491
+ .container {
492
+ /*max-width: 350px;*/
493
+ margin: 0 auto;
494
+ /*padding: 30px 100px 50px 100px;
495
+ height: 350px;*/
496
+ text-align: center;
497
+ /*以下增加*/
498
+ /*background: #2D83BA;
499
+ background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
500
+ background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);*/
501
+ opacity: 0.8;
502
+ }
503
+
504
+ .container h3 {
505
+ font-size: 40px;
506
+ -webkit-transition-duration: 1s;
507
+ transition-duration: 1s;
508
+ -webkit-transition-timing-function: ease-in-out;
509
+ transition-timing-function: ease-in-out;
510
+ font-weight: 200;
511
+ }
512
+
513
+ .form {
514
+ padding: 20px 0;
515
+ /*margin-top: 15%;*/
516
+ position: relative;
517
+ z-index: 2;
518
+ }
519
+
520
+ .form input {
521
+ -webkit-appearance: none;
522
+ -moz-appearance: none;
523
+ appearance: none;
524
+ outline: 0;
525
+ border: 1px solid #50ABE6;
526
+ background-color: #50ABE6;
527
+ width: 250px;
528
+ border-radius: 3px;
529
+ padding: 10px 15px;
530
+ margin: 0 auto 10px auto;
531
+ display: block;
532
+ text-align: center;
533
+ font-size: 18px;
534
+ color: white;
535
+ -webkit-transition-duration: 0.25s;
536
+ transition-duration: 0.25s;
537
+ font-weight: 300;
538
+ }
539
+
540
+ .form input:hover {
541
+ background-color: rgba(255, 255, 255, 0.4);
542
+ }
543
+
544
+ .form input:focus {
545
+ background-color: white;
546
+ width: 300px;
547
+ color: #53e3a6;
548
+ }
549
+
550
+ .usericon {
551
+ background-image: url(../assets/usericon.png);
552
+ background-repeat: no-repeat;
553
+ background-size: 30px;
554
+ background-position-x: 8px;
555
+ background-position-y: 8px;
556
+ }
557
+
558
+ .psicon {
559
+ background-image: url(../assets/psicon.png);
560
+ background-repeat: no-repeat;
561
+ background-size: 30px;
562
+ background-position-x: 8px;
563
+ background-position-y: 8px;
564
+ }
565
+
566
+ .form button {
567
+ -webkit-appearance: none;
568
+ -moz-appearance: none;
569
+ appearance: none;
570
+ outline: 0;
571
+ background-color: white;
572
+ border: 0;
573
+ padding: 10px 15px;
574
+ color: #253830;
575
+ border-radius: 3px;
576
+ width: 250px;
577
+ cursor: pointer;
578
+ font-size: 18px;
579
+ -webkit-transition-duration: 0.25s;
580
+ transition-duration: 0.25s;
581
+ }
582
+
583
+ .form button:hover {
584
+ background-color: #f5f7f9;
585
+ }
586
+
587
+ /*注册字体样式*/
588
+ .form span {
589
+ color: #fff;
590
+ display: table-footer-group;
591
+ position: absolute;
592
+ right: 10px;
593
+ margin-top: 10px;
594
+ cursor: pointer;
595
+ }
596
+
597
+ .logotitle {
598
+ color: #fff;
599
+ position: absolute;
600
+ top: 50px;
601
+ left: 50px;
602
+ font-size: 50px;
603
+ }
604
+
605
+ /*注册模态框界面样式*/
606
+ .modifystyle {
607
+ background: #FCFEEE;
608
+ }
609
+
610
+ .modifystyle div {
611
+ height: auto;
612
+ margin-bottom: 15px;
613
+ /*text-align: center;*/
614
+ /*margin-left: 20%;*/
615
+ }
616
+
617
+ /*bootstrap字体图标要手动调整,所以使用字体图标的span必须紧跟在input后面,负责会错位*/
618
+ .modifystyle div input + span {
619
+ top: 0 !important;
620
+ right: 32%;
621
+ }
622
+
623
+ .modifystyle span {
624
+ color: red;
625
+ }
626
+
627
+ /* 通告区内容 */
628
+ .notice-board {
629
+ height: auto;
630
+ position: absolute;
631
+ top: 50%;
632
+ margin-top: -150px;
633
+ margin-left: 100px;
634
+ color: #fff;
635
+ }
636
+
637
+ /*修改密码底部按钮部分样式*/
638
+ .footerbtn {
639
+ text-align: center;
640
+ padding: 15px;
641
+ }
642
+
643
+ .footerbtn button {
644
+ width: 100px;
645
+ margin-left: 20px;
646
+ }
647
+
648
+ .bg-bubbles {
649
+ position: absolute;
650
+ top: 0;
651
+ left: 0;
652
+ width: 100%;
653
+ height: 100%;
654
+ z-index: 1;
655
+ }
656
+
657
+ .bg-bubbles li {
658
+ position: absolute;
659
+ list-style: none;
660
+ display: block;
661
+ width: 40px;
662
+ height: 40px;
663
+ background-color: rgba(255, 255, 255, 0.15);
664
+ bottom: -160px;
665
+ -webkit-animation: square 25s infinite;
666
+ animation: square 25s infinite;
667
+ -webkit-transition-timing-function: linear;
668
+ transition-timing-function: linear;
669
+ }
670
+
671
+ .bg-bubbles li:nth-child(1) {
672
+ left: 10%;
673
+ }
674
+
675
+ .bg-bubbles li:nth-child(2) {
676
+ left: 20%;
677
+ width: 80px;
678
+ height: 80px;
679
+ -webkit-animation-delay: 2s;
680
+ animation-delay: 2s;
681
+ -webkit-animation-duration: 17s;
682
+ animation-duration: 17s;
683
+ }
684
+
685
+ .bg-bubbles li:nth-child(3) {
686
+ left: 25%;
687
+ -webkit-animation-delay: 4s;
688
+ animation-delay: 4s;
689
+ }
690
+
691
+ .bg-bubbles li:nth-child(4) {
692
+ left: 40%;
693
+ width: 60px;
694
+ height: 60px;
695
+ -webkit-animation-duration: 22s;
696
+ animation-duration: 22s;
697
+ background-color: rgba(255, 255, 255, 0.25);
698
+ }
699
+
700
+ .bg-bubbles li:nth-child(5) {
701
+ left: 70%;
702
+ }
703
+
704
+ .bg-bubbles li:nth-child(6) {
705
+ left: 80%;
706
+ width: 120px;
707
+ height: 120px;
708
+ -webkit-animation-delay: 3s;
709
+ animation-delay: 3s;
710
+ background-color: rgba(255, 255, 255, 0.2);
711
+ }
712
+
713
+ .bg-bubbles li:nth-child(7) {
714
+ left: 32%;
715
+ width: 160px;
716
+ height: 160px;
717
+ -webkit-animation-delay: 7s;
718
+ animation-delay: 7s;
719
+ }
720
+
721
+ .bg-bubbles li:nth-child(8) {
722
+ left: 55%;
723
+ width: 20px;
724
+ height: 20px;
725
+ -webkit-animation-delay: 15s;
726
+ animation-delay: 15s;
727
+ -webkit-animation-duration: 40s;
728
+ animation-duration: 40s;
729
+ }
730
+
731
+ .bg-bubbles li:nth-child(9) {
732
+ left: 25%;
733
+ width: 10px;
734
+ height: 10px;
735
+ -webkit-animation-delay: 2s;
736
+ animation-delay: 2s;
737
+ -webkit-animation-duration: 40s;
738
+ animation-duration: 40s;
739
+ background-color: rgba(255, 255, 255, 0.3);
740
+ }
741
+
742
+ .bg-bubbles li:nth-child(10) {
743
+ left: 90%;
744
+ width: 160px;
745
+ height: 160px;
746
+ -webkit-animation-delay: 11s;
747
+ animation-delay: 11s;
748
+ }
749
+
750
+ @-webkit-keyframes square {
751
+ 0% {
752
+ -webkit-transform: translateY(0);
753
+ transform: translateY(0);
754
+ }
755
+ 100% {
756
+ -webkit-transform: translateY(-700px) rotate(600deg);
757
+ transform: translateY(-700px) rotate(600deg);
758
+ }
759
+ }
760
+
761
+ @keyframes square {
762
+ 0% {
763
+ -webkit-transform: translateY(0);
764
+ transform: translateY(0);
765
+ }
766
+ 100% {
767
+ -webkit-transform: translateY(-700px) rotate(600deg);
768
+ transform: translateY(-700px) rotate(600deg);
769
+ }
770
+ }
771
+
772
+ .loading {
773
+ width: 36%;
774
+ height: 7%;
775
+ position: absolute;
776
+ top: 30%;
777
+ left: 32%;
778
+ line-height: 56px;
779
+ color: #fff;
780
+ padding-left: 60px;
781
+ font-size: 15px;
782
+ background: #000 url(../assets/loging.gif) no-repeat 10px 50%;
783
+ opacity: 0.7;
784
+ z-index: 9999;
785
+ -moz-border-radius: 20px;
786
+ -webkit-border-radius: 20px;
787
+ border-radius: 20px;
788
+ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);
789
+ }
790
+ </style>