system-phone 3.1.40 → 3.1.42

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 (201) hide show
  1. package/.babelrc +5 -5
  2. package/.editorconfig +9 -9
  3. package/.eslintrc.js +16 -16
  4. package/CHANGELOG.md +1 -1
  5. package/Dockerfile +3 -3
  6. package/README.md +36 -36
  7. package/build/css-loaders.js +34 -34
  8. package/build/dev-client.js +8 -8
  9. package/build/example-server.js +80 -80
  10. package/build/release.sh +28 -28
  11. package/build/utils.js +71 -71
  12. package/build/webpack.dev.conf.js +31 -31
  13. package/build/webpack.example.conf.js +49 -49
  14. package/build/webpack.prod.conf.js +60 -60
  15. package/build/webpack.test.conf.js +31 -31
  16. package/config/dev.env.js +6 -6
  17. package/config/index.js +38 -38
  18. package/config/prod.env.js +3 -3
  19. package/config/test.env.js +6 -6
  20. package/nginx.conf +304 -304
  21. package/package.json +1 -1
  22. package/release.bat +5 -5
  23. package/src/App.vue +25 -25
  24. package/src/Util.js +415 -415
  25. package/src/android-bootstrap/fonts/glyphicons-halflings-regular.svg +287 -287
  26. package/src/android-bootstrap/less/.csscomb.json +304 -304
  27. package/src/android-bootstrap/less/.csslintrc +19 -19
  28. package/src/android-bootstrap/less/alerts.less +73 -73
  29. package/src/android-bootstrap/less/badges.less +66 -66
  30. package/src/android-bootstrap/less/bootstrap.less +56 -56
  31. package/src/android-bootstrap/less/breadcrumbs.less +26 -26
  32. package/src/android-bootstrap/less/button-groups.less +247 -247
  33. package/src/android-bootstrap/less/buttons.less +173 -173
  34. package/src/android-bootstrap/less/carousel.less +269 -269
  35. package/src/android-bootstrap/less/close.less +34 -34
  36. package/src/android-bootstrap/less/code.less +69 -69
  37. package/src/android-bootstrap/less/component-animations.less +33 -33
  38. package/src/android-bootstrap/less/dropdowns.less +216 -216
  39. package/src/android-bootstrap/less/forms.less +626 -626
  40. package/src/android-bootstrap/less/glyphicons.less +305 -305
  41. package/src/android-bootstrap/less/grid.less +84 -84
  42. package/src/android-bootstrap/less/input-groups.less +167 -167
  43. package/src/android-bootstrap/less/jumbotron.less +52 -52
  44. package/src/android-bootstrap/less/labels.less +64 -64
  45. package/src/android-bootstrap/less/list-group.less +141 -141
  46. package/src/android-bootstrap/less/media.less +66 -66
  47. package/src/android-bootstrap/less/mixins/alerts.less +14 -14
  48. package/src/android-bootstrap/less/mixins/background-variant.less +9 -9
  49. package/src/android-bootstrap/less/mixins/border-radius.less +18 -18
  50. package/src/android-bootstrap/less/mixins/buttons.less +69 -69
  51. package/src/android-bootstrap/less/mixins/center-block.less +7 -7
  52. package/src/android-bootstrap/less/mixins/clearfix.less +22 -22
  53. package/src/android-bootstrap/less/mixins/forms.less +90 -90
  54. package/src/android-bootstrap/less/mixins/gradients.less +59 -59
  55. package/src/android-bootstrap/less/mixins/grid-framework.less +92 -92
  56. package/src/android-bootstrap/less/mixins/grid.less +122 -122
  57. package/src/android-bootstrap/less/mixins/hide-text.less +21 -21
  58. package/src/android-bootstrap/less/mixins/image.less +33 -33
  59. package/src/android-bootstrap/less/mixins/labels.less +12 -12
  60. package/src/android-bootstrap/less/mixins/list-group.less +30 -30
  61. package/src/android-bootstrap/less/mixins/nav-divider.less +10 -10
  62. package/src/android-bootstrap/less/mixins/nav-vertical-align.less +9 -9
  63. package/src/android-bootstrap/less/mixins/opacity.less +8 -8
  64. package/src/android-bootstrap/less/mixins/pagination.less +24 -24
  65. package/src/android-bootstrap/less/mixins/panels.less +24 -24
  66. package/src/android-bootstrap/less/mixins/progress-bar.less +10 -10
  67. package/src/android-bootstrap/less/mixins/reset-filter.less +8 -8
  68. package/src/android-bootstrap/less/mixins/reset-text.less +18 -18
  69. package/src/android-bootstrap/less/mixins/resize.less +6 -6
  70. package/src/android-bootstrap/less/mixins/responsive-visibility.less +15 -15
  71. package/src/android-bootstrap/less/mixins/size.less +10 -10
  72. package/src/android-bootstrap/less/mixins/tab-focus.less +9 -9
  73. package/src/android-bootstrap/less/mixins/table-row.less +44 -44
  74. package/src/android-bootstrap/less/mixins/text-emphasis.less +9 -9
  75. package/src/android-bootstrap/less/mixins/text-overflow.less +8 -8
  76. package/src/android-bootstrap/less/mixins/vendor-prefixes.less +227 -227
  77. package/src/android-bootstrap/less/mixins.less +40 -40
  78. package/src/android-bootstrap/less/modals.less +151 -151
  79. package/src/android-bootstrap/less/navbar.less +660 -660
  80. package/src/android-bootstrap/less/navs.less +290 -290
  81. package/src/android-bootstrap/less/normalize.less +424 -424
  82. package/src/android-bootstrap/less/pager.less +76 -76
  83. package/src/android-bootstrap/less/pagination.less +89 -89
  84. package/src/android-bootstrap/less/panels.less +274 -274
  85. package/src/android-bootstrap/less/popovers.less +131 -131
  86. package/src/android-bootstrap/less/print.less +101 -101
  87. package/src/android-bootstrap/less/progress-bars.less +87 -87
  88. package/src/android-bootstrap/less/responsive-embed.less +35 -35
  89. package/src/android-bootstrap/less/responsive-utilities.less +194 -194
  90. package/src/android-bootstrap/less/scaffolding.less +161 -161
  91. package/src/android-bootstrap/less/tables.less +262 -262
  92. package/src/android-bootstrap/less/theme.less +291 -291
  93. package/src/android-bootstrap/less/thumbnails.less +36 -36
  94. package/src/android-bootstrap/less/tooltip.less +102 -102
  95. package/src/android-bootstrap/less/type.less +303 -303
  96. package/src/android-bootstrap/less/utilities.less +55 -55
  97. package/src/android-bootstrap/less/variables.less +896 -896
  98. package/src/android-bootstrap/less/wells.less +29 -29
  99. package/src/bootstrap/fonts/glyphicons-halflings-regular.svg +287 -287
  100. package/src/bootstrap/less/.csscomb.json +304 -304
  101. package/src/bootstrap/less/.csslintrc +19 -19
  102. package/src/bootstrap/less/alerts.less +73 -73
  103. package/src/bootstrap/less/badges.less +66 -66
  104. package/src/bootstrap/less/bootstrap.less +56 -56
  105. package/src/bootstrap/less/breadcrumbs.less +26 -26
  106. package/src/bootstrap/less/button-groups.less +247 -247
  107. package/src/bootstrap/less/buttons.less +172 -172
  108. package/src/bootstrap/less/carousel.less +269 -269
  109. package/src/bootstrap/less/close.less +34 -34
  110. package/src/bootstrap/less/code.less +69 -69
  111. package/src/bootstrap/less/component-animations.less +33 -33
  112. package/src/bootstrap/less/dropdowns.less +216 -216
  113. package/src/bootstrap/less/forms.less +626 -626
  114. package/src/bootstrap/less/glyphicons.less +305 -305
  115. package/src/bootstrap/less/grid.less +84 -84
  116. package/src/bootstrap/less/input-groups.less +167 -167
  117. package/src/bootstrap/less/jumbotron.less +52 -52
  118. package/src/bootstrap/less/labels.less +64 -64
  119. package/src/bootstrap/less/list-group.less +141 -141
  120. package/src/bootstrap/less/media.less +66 -66
  121. package/src/bootstrap/less/mixins/alerts.less +14 -14
  122. package/src/bootstrap/less/mixins/background-variant.less +9 -9
  123. package/src/bootstrap/less/mixins/border-radius.less +18 -18
  124. package/src/bootstrap/less/mixins/buttons.less +69 -69
  125. package/src/bootstrap/less/mixins/center-block.less +7 -7
  126. package/src/bootstrap/less/mixins/clearfix.less +22 -22
  127. package/src/bootstrap/less/mixins/forms.less +90 -90
  128. package/src/bootstrap/less/mixins/gradients.less +59 -59
  129. package/src/bootstrap/less/mixins/grid-framework.less +92 -92
  130. package/src/bootstrap/less/mixins/grid.less +122 -122
  131. package/src/bootstrap/less/mixins/hide-text.less +21 -21
  132. package/src/bootstrap/less/mixins/image.less +33 -33
  133. package/src/bootstrap/less/mixins/labels.less +12 -12
  134. package/src/bootstrap/less/mixins/list-group.less +30 -30
  135. package/src/bootstrap/less/mixins/nav-divider.less +10 -10
  136. package/src/bootstrap/less/mixins/nav-vertical-align.less +9 -9
  137. package/src/bootstrap/less/mixins/opacity.less +8 -8
  138. package/src/bootstrap/less/mixins/pagination.less +24 -24
  139. package/src/bootstrap/less/mixins/panels.less +24 -24
  140. package/src/bootstrap/less/mixins/progress-bar.less +10 -10
  141. package/src/bootstrap/less/mixins/reset-filter.less +8 -8
  142. package/src/bootstrap/less/mixins/reset-text.less +18 -18
  143. package/src/bootstrap/less/mixins/resize.less +6 -6
  144. package/src/bootstrap/less/mixins/responsive-visibility.less +15 -15
  145. package/src/bootstrap/less/mixins/size.less +10 -10
  146. package/src/bootstrap/less/mixins/tab-focus.less +9 -9
  147. package/src/bootstrap/less/mixins/table-row.less +44 -44
  148. package/src/bootstrap/less/mixins/text-emphasis.less +9 -9
  149. package/src/bootstrap/less/mixins/text-overflow.less +8 -8
  150. package/src/bootstrap/less/mixins/vendor-prefixes.less +227 -227
  151. package/src/bootstrap/less/mixins.less +40 -40
  152. package/src/bootstrap/less/modals.less +151 -151
  153. package/src/bootstrap/less/navbar.less +660 -660
  154. package/src/bootstrap/less/navs.less +286 -286
  155. package/src/bootstrap/less/normalize.less +424 -424
  156. package/src/bootstrap/less/pager.less +76 -76
  157. package/src/bootstrap/less/pagination.less +89 -89
  158. package/src/bootstrap/less/panels.less +275 -275
  159. package/src/bootstrap/less/popovers.less +131 -131
  160. package/src/bootstrap/less/print.less +101 -101
  161. package/src/bootstrap/less/progress-bars.less +87 -87
  162. package/src/bootstrap/less/responsive-embed.less +35 -35
  163. package/src/bootstrap/less/responsive-utilities.less +194 -194
  164. package/src/bootstrap/less/scaffolding.less +161 -161
  165. package/src/bootstrap/less/tables.less +262 -262
  166. package/src/bootstrap/less/theme.less +291 -291
  167. package/src/bootstrap/less/thumbnails.less +36 -36
  168. package/src/bootstrap/less/tooltip.less +102 -102
  169. package/src/bootstrap/less/type.less +303 -303
  170. package/src/bootstrap/less/utilities.less +55 -55
  171. package/src/bootstrap/less/variables.less +895 -895
  172. package/src/bootstrap/less/wells.less +29 -29
  173. package/src/components/AloneLoadParams.vue +26 -26
  174. package/src/components/AlreadyService.vue +210 -210
  175. package/src/components/AttendManage.vue +591 -591
  176. package/src/components/LoadAppdata.vue +38 -38
  177. package/src/components/LoginAppV4.vue +787 -790
  178. package/src/components/ModifyPassWord.vue +216 -216
  179. package/src/components/OnlineManage.vue +278 -278
  180. package/src/components/PhoneSellInfo.vue +148 -148
  181. package/src/components/Test.vue +14 -14
  182. package/src/filiale/liaoyuan/LoginApp.vue +734 -725
  183. package/src/filiale/liaoyuan/SystemSetUp.vue +352 -0
  184. package/src/filiale/liaoyuan/systemphonegrid.js +1 -0
  185. package/src/plugins/GetStringData.js +18 -18
  186. package/src/plugins/LoadParams.js +24 -24
  187. package/src/services/ConfigService.js +24 -24
  188. package/static/app.json +4 -4
  189. package/static/globals.txt +74 -74
  190. package/test/unit/.eslintrc +5 -5
  191. package/test/unit/TestUtil.js +35 -35
  192. package/test/unit/context.html +20 -20
  193. package/test/unit/index.js +13 -13
  194. package/test/unit/init.js +13 -13
  195. package/test/unit/karma.conf.js +50 -50
  196. package/test/unit/specs/App.spec.js +17 -17
  197. package/test/unit/specs/Test.spec.js +28 -28
  198. package/test/unit/specs/components/LoginApp.spec.js +21 -21
  199. package/test/unit/specs/sevices/ConfigService.spec.js +23 -23
  200. package/test/unit/specs/sevices/GetDBTest.spec.js +28 -28
  201. package/src/plugins/validateStrongPasswordPhone.js +0 -162
@@ -1,790 +1,787 @@
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
+ //获取json配置文件
67
+ let asyncReady = async function (self, url) {
68
+ // 获取配置信息
69
+ try {
70
+ console.log('获取营收配置文件和参数【开始】')
71
+ await self.$appdata.load()
72
+ console.log('获取营收配置文件和参数【结束】,开始获取vue配置文件【开始】')
73
+ let that = self
74
+ let vueConfig={}
75
+ let dir_module = []
76
+ const res = await Vue.resetget(`${url}/api/af-safecheck/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
77
+ if(res.data.global){
78
+ self.delConfigKey(res.data)
79
+ dir_module = res.data.global.dir_module
80
+ vueConfig.safecheck = res.data
81
+ } else {
82
+ vueConfig = res.data
83
+ }
84
+ for(let mod in dir_module) {
85
+ if (dir_module[mod].name !== 'af-safecheck') {
86
+ let mod_url = `${url}/api/${dir_module[mod].name}/vue`
87
+ if (!dir_module[mod].name.startsWith('af-')) {
88
+ mod_url = `${url}/${dir_module[mod].name}/rs/vue`
89
+ }
90
+ let config = null
91
+ try{
92
+ config = await Vue.resetget(mod_url, {data: {}}, {resolveMsg: null, rejectMsg: null})
93
+ }catch (e) {
94
+ console.log('获取配置报错-先跳过', e)
95
+ }
96
+ // 拿到的配置有问题就跳过
97
+ if(config && config.data instanceof Object){
98
+ self.delConfigKey(config.data)
99
+ vueConfig[dir_module[mod].name] = config.data;
100
+ }
101
+ }
102
+ }
103
+ that.$set('config', vueConfig)
104
+ Vue.config2 = vueConfig
105
+ // 判断是否需要弱密码校验
106
+ if (self.config && self.config.telephone && self.config.telephone.LoginApp && 'undefined' != typeof self.config.telephone.LoginApp.weakPassword) {
107
+ self.weakPassword = self.config.telephone.LoginApp.weakPassword
108
+ Vue.weakPassword = self.config.telephone.LoginApp.weakPassword
109
+ }
110
+ console.log('手机端获取.json文件')
111
+ console.log(JSON.stringify(self.config))
112
+ return true
113
+ } catch (error) {
114
+ console.log(error)
115
+ // 此处业务数据装载异常不做任何处理,理论上不会有任何异常
116
+ self.$showMessage('登录系统: 获取配置文件失败,请检查网络后重新登陆!')
117
+ return false
118
+ }
119
+ }
120
+
121
+ //装载业务数据
122
+ let asyncLoadData = async function (self, url) {
123
+ try {
124
+ // 读取报建本地配置文件
125
+ var result = HostApp.readLocalFile('workflow_apply.json')
126
+ if (result.code == 500) {
127
+ console.log('不存在流程配置文件,即不使用报建app')
128
+ return
129
+ }
130
+ var data = JSON.parse(result.data)
131
+ console.log('读取报建配置文件成功,存入缓存中的data=>' + JSON.stringify(data))
132
+ Vue.workflow_vue = Vue.prototype.$workflow_vue = data
133
+ } catch (error) {
134
+ // 此处业务数据装载异常不做任何处理,理论上不会有任何异常,只有当app版本端版本较低无readlocalfile时会异常
135
+ console.log(error)
136
+ }
137
+ }
138
+
139
+ export default {
140
+ title: '登录系统',
141
+ data () {
142
+ return {
143
+ loaderShow: false,
144
+ config: {},
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 && !(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*(),.?":{}|<>~`+=_\\-])[A-Za-z\d!@#$%^&*(),.?":{}|<>~`+=_\\-]{8,}$/.test(this.password))) {
364
+ await this.$showMessage('登录系统: 此账户的密码过于简单,请修改密码后重新登陆!!!', ['confirm'])
365
+ this.modifyPassword = true
366
+ return
367
+ }
368
+ this.$goto('nav-bottom')
369
+ } catch (e) {
370
+ if (Vue.android) {
371
+ this.loaderShow = false
372
+ }
373
+ console.error('登录异常,LoginApp的confirm函数错误', e)
374
+ this.$showMessage('登陆失败!,')
375
+ }
376
+ },
377
+ RSADecrypt(encryptedData) {
378
+ try {
379
+ const pk = this.$androidUtil.getPreference('v4PrivateKey')
380
+ const decryptor = new JSEncrypt();
381
+ decryptor.setPrivateKey(pk);
382
+ const decrypted = decryptor.decrypt(encryptedData);
383
+
384
+ if (!decrypted) {
385
+ throw new Error('解密失败:空结果');
386
+ }
387
+ return decrypted;
388
+ } catch (error) {
389
+ console.error('RSA解密错误:', error);
390
+ throw new Error('RSA解密失败,请检查私钥格式');
391
+ }
392
+ },
393
+
394
+ delConfigKey(obj){
395
+ // 从琉璃中获取的配置中会包含 $开头的一些额外描述新的key。为了兼容v3的代码逻辑在此函数中去掉
396
+ Object.keys(obj).forEach(key =>{
397
+ Object.keys(obj[key]).forEach(col => {
398
+ // 检查键是否以$开头
399
+ if (col.startsWith('$')) {
400
+ // 使用delete操作符删除键
401
+ delete obj[key][col];
402
+ }
403
+ })
404
+ })
405
+ }
406
+ },
407
+ watch: {
408
+ 'config' (val) {
409
+ Vue.config = val
410
+ }
411
+ }
412
+ }
413
+ </script>
414
+ <style scoped="">
415
+ .devicetext {
416
+ font: 13px PingFang-SC-Medium;
417
+ position: fixed;
418
+ width: 100%;
419
+ bottom: 13px;
420
+ transform: translate(-50%, -50%);
421
+ }
422
+
423
+ /*输入框样式*/
424
+ /*@import url(http://fonts.useso.com/css?family=Source+Sans+Pro:200,300);*/
425
+ * {
426
+ box-sizing: border-box;
427
+ margin: 0;
428
+ padding: 0;
429
+ font-weight: 300;
430
+ }
431
+
432
+ .loginbg {
433
+ font-family: 'Source Sans Pro', sans-serif;
434
+ color: white;
435
+ font-weight: 300;
436
+ }
437
+
438
+ .loginbg ::-webkit-input-placeholder {
439
+ /* WebKit browsers */
440
+ font-family: 'Source Sans Pro', sans-serif;
441
+ color: white;
442
+ font-weight: 300;
443
+ }
444
+
445
+ .loginbg :-moz-placeholder {
446
+ /* Mozilla Firefox 4 to 18 */
447
+ font-family: 'Source Sans Pro', sans-serif;
448
+ color: white;
449
+ opacity: 1;
450
+ font-weight: 300;
451
+ }
452
+
453
+ .loginbg ::-moz-placeholder {
454
+ /* Mozilla Firefox 19+ */
455
+ font-family: 'Source Sans Pro', sans-serif;
456
+ color: white;
457
+ opacity: 1;
458
+ font-weight: 300;
459
+ }
460
+
461
+ .loginbg :-ms-input-placeholder {
462
+ /* Internet Explorer 10+ */
463
+ font-family: 'Source Sans Pro', sans-serif;
464
+ color: white;
465
+ font-weight: 300;
466
+ }
467
+
468
+ .wrapper {
469
+ /*background: #2D83BA;
470
+ background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
471
+ background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);
472
+ opacity: 0.8;*/
473
+ /*position: absolute;*/
474
+ /*top: 50%;
475
+ right: 10%;
476
+ width: 40%;
477
+ height: 350px;
478
+ margin-top: -150px;*/
479
+ overflow: hidden;
480
+ }
481
+
482
+ .wrapper.form-success .container h3 {
483
+ -webkit-transform: translateY(85px);
484
+ -ms-transform: translateY(85px);
485
+ transform: translateY(85px);
486
+ }
487
+
488
+ .container {
489
+ /*max-width: 350px;*/
490
+ margin: 0 auto;
491
+ /*padding: 30px 100px 50px 100px;
492
+ height: 350px;*/
493
+ text-align: center;
494
+ /*以下增加*/
495
+ /*background: #2D83BA;
496
+ background: -webkit-linear-gradient(top left, #2D83BA 0%, #2D83BA 100%);
497
+ background: linear-gradient(to bottom right, #2D83BA 0%, #2D83BA 100%);*/
498
+ opacity: 0.8;
499
+ }
500
+
501
+ .container h3 {
502
+ font-size: 40px;
503
+ -webkit-transition-duration: 1s;
504
+ transition-duration: 1s;
505
+ -webkit-transition-timing-function: ease-in-out;
506
+ transition-timing-function: ease-in-out;
507
+ font-weight: 200;
508
+ }
509
+
510
+ .form {
511
+ padding: 20px 0;
512
+ /*margin-top: 15%;*/
513
+ position: relative;
514
+ z-index: 2;
515
+ }
516
+
517
+ .form input {
518
+ -webkit-appearance: none;
519
+ -moz-appearance: none;
520
+ appearance: none;
521
+ outline: 0;
522
+ border: 1px solid #50ABE6;
523
+ background-color: #50ABE6;
524
+ width: 250px;
525
+ border-radius: 3px;
526
+ padding: 10px 15px;
527
+ margin: 0 auto 10px auto;
528
+ display: block;
529
+ text-align: center;
530
+ font-size: 18px;
531
+ color: white;
532
+ -webkit-transition-duration: 0.25s;
533
+ transition-duration: 0.25s;
534
+ font-weight: 300;
535
+ }
536
+
537
+ .form input:hover {
538
+ background-color: rgba(255, 255, 255, 0.4);
539
+ }
540
+
541
+ .form input:focus {
542
+ background-color: white;
543
+ width: 300px;
544
+ color: #53e3a6;
545
+ }
546
+
547
+ .usericon {
548
+ background-image: url(../assets/usericon.png);
549
+ background-repeat: no-repeat;
550
+ background-size: 30px;
551
+ background-position-x: 8px;
552
+ background-position-y: 8px;
553
+ }
554
+
555
+ .psicon {
556
+ background-image: url(../assets/psicon.png);
557
+ background-repeat: no-repeat;
558
+ background-size: 30px;
559
+ background-position-x: 8px;
560
+ background-position-y: 8px;
561
+ }
562
+
563
+ .form button {
564
+ -webkit-appearance: none;
565
+ -moz-appearance: none;
566
+ appearance: none;
567
+ outline: 0;
568
+ background-color: white;
569
+ border: 0;
570
+ padding: 10px 15px;
571
+ color: #253830;
572
+ border-radius: 3px;
573
+ width: 250px;
574
+ cursor: pointer;
575
+ font-size: 18px;
576
+ -webkit-transition-duration: 0.25s;
577
+ transition-duration: 0.25s;
578
+ }
579
+
580
+ .form button:hover {
581
+ background-color: #f5f7f9;
582
+ }
583
+
584
+ /*注册字体样式*/
585
+ .form span {
586
+ color: #fff;
587
+ display: table-footer-group;
588
+ position: absolute;
589
+ right: 10px;
590
+ margin-top: 10px;
591
+ cursor: pointer;
592
+ }
593
+
594
+ .logotitle {
595
+ color: #fff;
596
+ position: absolute;
597
+ top: 50px;
598
+ left: 50px;
599
+ font-size: 50px;
600
+ }
601
+
602
+ /*注册模态框界面样式*/
603
+ .modifystyle {
604
+ background: #FCFEEE;
605
+ }
606
+
607
+ .modifystyle div {
608
+ height: auto;
609
+ margin-bottom: 15px;
610
+ /*text-align: center;*/
611
+ /*margin-left: 20%;*/
612
+ }
613
+
614
+ /*bootstrap字体图标要手动调整,所以使用字体图标的span必须紧跟在input后面,负责会错位*/
615
+ .modifystyle div input + span {
616
+ top: 0 !important;
617
+ right: 32%;
618
+ }
619
+
620
+ .modifystyle span {
621
+ color: red;
622
+ }
623
+
624
+ /* 通告区内容 */
625
+ .notice-board {
626
+ height: auto;
627
+ position: absolute;
628
+ top: 50%;
629
+ margin-top: -150px;
630
+ margin-left: 100px;
631
+ color: #fff;
632
+ }
633
+
634
+ /*修改密码底部按钮部分样式*/
635
+ .footerbtn {
636
+ text-align: center;
637
+ padding: 15px;
638
+ }
639
+
640
+ .footerbtn button {
641
+ width: 100px;
642
+ margin-left: 20px;
643
+ }
644
+
645
+ .bg-bubbles {
646
+ position: absolute;
647
+ top: 0;
648
+ left: 0;
649
+ width: 100%;
650
+ height: 100%;
651
+ z-index: 1;
652
+ }
653
+
654
+ .bg-bubbles li {
655
+ position: absolute;
656
+ list-style: none;
657
+ display: block;
658
+ width: 40px;
659
+ height: 40px;
660
+ background-color: rgba(255, 255, 255, 0.15);
661
+ bottom: -160px;
662
+ -webkit-animation: square 25s infinite;
663
+ animation: square 25s infinite;
664
+ -webkit-transition-timing-function: linear;
665
+ transition-timing-function: linear;
666
+ }
667
+
668
+ .bg-bubbles li:nth-child(1) {
669
+ left: 10%;
670
+ }
671
+
672
+ .bg-bubbles li:nth-child(2) {
673
+ left: 20%;
674
+ width: 80px;
675
+ height: 80px;
676
+ -webkit-animation-delay: 2s;
677
+ animation-delay: 2s;
678
+ -webkit-animation-duration: 17s;
679
+ animation-duration: 17s;
680
+ }
681
+
682
+ .bg-bubbles li:nth-child(3) {
683
+ left: 25%;
684
+ -webkit-animation-delay: 4s;
685
+ animation-delay: 4s;
686
+ }
687
+
688
+ .bg-bubbles li:nth-child(4) {
689
+ left: 40%;
690
+ width: 60px;
691
+ height: 60px;
692
+ -webkit-animation-duration: 22s;
693
+ animation-duration: 22s;
694
+ background-color: rgba(255, 255, 255, 0.25);
695
+ }
696
+
697
+ .bg-bubbles li:nth-child(5) {
698
+ left: 70%;
699
+ }
700
+
701
+ .bg-bubbles li:nth-child(6) {
702
+ left: 80%;
703
+ width: 120px;
704
+ height: 120px;
705
+ -webkit-animation-delay: 3s;
706
+ animation-delay: 3s;
707
+ background-color: rgba(255, 255, 255, 0.2);
708
+ }
709
+
710
+ .bg-bubbles li:nth-child(7) {
711
+ left: 32%;
712
+ width: 160px;
713
+ height: 160px;
714
+ -webkit-animation-delay: 7s;
715
+ animation-delay: 7s;
716
+ }
717
+
718
+ .bg-bubbles li:nth-child(8) {
719
+ left: 55%;
720
+ width: 20px;
721
+ height: 20px;
722
+ -webkit-animation-delay: 15s;
723
+ animation-delay: 15s;
724
+ -webkit-animation-duration: 40s;
725
+ animation-duration: 40s;
726
+ }
727
+
728
+ .bg-bubbles li:nth-child(9) {
729
+ left: 25%;
730
+ width: 10px;
731
+ height: 10px;
732
+ -webkit-animation-delay: 2s;
733
+ animation-delay: 2s;
734
+ -webkit-animation-duration: 40s;
735
+ animation-duration: 40s;
736
+ background-color: rgba(255, 255, 255, 0.3);
737
+ }
738
+
739
+ .bg-bubbles li:nth-child(10) {
740
+ left: 90%;
741
+ width: 160px;
742
+ height: 160px;
743
+ -webkit-animation-delay: 11s;
744
+ animation-delay: 11s;
745
+ }
746
+
747
+ @-webkit-keyframes square {
748
+ 0% {
749
+ -webkit-transform: translateY(0);
750
+ transform: translateY(0);
751
+ }
752
+ 100% {
753
+ -webkit-transform: translateY(-700px) rotate(600deg);
754
+ transform: translateY(-700px) rotate(600deg);
755
+ }
756
+ }
757
+
758
+ @keyframes square {
759
+ 0% {
760
+ -webkit-transform: translateY(0);
761
+ transform: translateY(0);
762
+ }
763
+ 100% {
764
+ -webkit-transform: translateY(-700px) rotate(600deg);
765
+ transform: translateY(-700px) rotate(600deg);
766
+ }
767
+ }
768
+
769
+ .loading {
770
+ width: 36%;
771
+ height: 7%;
772
+ position: absolute;
773
+ top: 30%;
774
+ left: 32%;
775
+ line-height: 56px;
776
+ color: #fff;
777
+ padding-left: 60px;
778
+ font-size: 15px;
779
+ background: #000 url(../assets/loging.gif) no-repeat 10px 50%;
780
+ opacity: 0.7;
781
+ z-index: 9999;
782
+ -moz-border-radius: 20px;
783
+ -webkit-border-radius: 20px;
784
+ border-radius: 20px;
785
+ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);
786
+ }
787
+ </style>