index.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  1. <template>
  2. <div class="newLogin">
  3. <div class="logoBox">
  4. <img class="logo" src="./newLoginImage/LOGO.svg">
  5. <span style="margin-left: 0.5vw">无锡市安居投资发展有限公司</span>
  6. </div>
  7. <div class="QRcodeBody">
  8. <img src="./image/QRcode.svg" class="QRcode">
  9. <span class="qrInfo">扫一扫进微信小程序</span>
  10. </div>
  11. <div class="loginBox">
  12. <div class="objectName">
  13. 保障管理系统
  14. </div>
  15. <div class="tabBody">
  16. <!-- <el-tabs v-model="activeName" @tab-click="handleClick">-->
  17. <!-- <el-tab-pane label="领导小组" name="领导小组">-->
  18. <!-- <div class="MsgBox">-->
  19. <!-- <div style="color: #777777;font-size: 1vw">欢迎登录</div>-->
  20. <!-- <el-form-->
  21. <!-- ref="loginForm"-->
  22. <!-- :model="loginForm"-->
  23. <!-- :rules="loginRules"-->
  24. <!-- auto-complete="on"-->
  25. <!-- class="inputBox"-->
  26. <!-- label-position="left"-->
  27. <!-- >-->
  28. <!-- <el-form-item prop="username">-->
  29. <!-- <el-input-->
  30. <!-- ref="username"-->
  31. <!-- v-model="loginForm.username"-->
  32. <!-- auto-complete="on"-->
  33. <!-- placeholder="请输入用户名"-->
  34. <!-- prefix-icon="el-icon-user"-->
  35. <!-- tabindex="1"-->
  36. <!-- type="text"-->
  37. <!-- />-->
  38. <!-- </el-form-item>-->
  39. <!-- <div class="forgetBox">-->
  40. <!-- <el-form-item prop="password">-->
  41. <!-- <el-input-->
  42. <!-- ref="password"-->
  43. <!-- v-model="loginForm.password"-->
  44. <!-- auto-complete="on"-->
  45. <!-- placeholder="请输入密码"-->
  46. <!-- prefix-icon="el-icon-lock"-->
  47. <!-- show-password-->
  48. <!-- tabindex="2"-->
  49. <!-- />-->
  50. <!-- </el-form-item>-->
  51. <!-- </div>-->
  52. <!-- <div class="yzBox">-->
  53. <!-- <el-form-item prop="validateCode">-->
  54. <!-- <el-input-->
  55. <!-- ref="validateCode"-->
  56. <!-- v-model="loginForm.validateCode"-->
  57. <!-- placeholder="验证码"-->
  58. <!-- prefix-icon="el-icon-key"-->
  59. <!-- tabindex="3"-->
  60. <!-- @keyup.enter.native="handleLogin"-->
  61. <!-- />-->
  62. <!-- </el-form-item>-->
  63. <!-- <img-->
  64. <!-- id="codeImg"-->
  65. <!-- :src="captchaImage"-->
  66. <!-- alt="点击更换"-->
  67. <!-- class="yzm"-->
  68. <!-- title="点击更换"-->
  69. <!-- @click="codeImageRefresh"-->
  70. <!-- >-->
  71. <!-- </div>-->
  72. <!-- &lt;!&ndash;记住密码 待接驳&ndash;&gt;-->
  73. <!-- <div class="remeber"><el-checkbox v-model="checked">-->
  74. <!-- <span style="font-size: 0.633vw;"> 记住密码</span>-->
  75. <!-- </el-checkbox>-->
  76. <!-- </div>-->
  77. <!-- <el-button-->
  78. <!-- class="eBtn"-->
  79. <!-- @click.native.prevent="handleLogin"-->
  80. <!-- >登 录</el-button>-->
  81. <!-- </el-form>-->
  82. <!-- <div class="ljzcBox" style="margin-top: 1.5vw">-->
  83. <!-- &lt;!&ndash; 联系管理员 待接驳 &ndash;&gt;-->
  84. <!-- 还没有账户?-->
  85. <!-- <el-tooltip class="item" content="电话:(0510) 6661 9939" effect="dark" placement="right">-->
  86. <!-- <span class="ljzc">联系管理员</span>-->
  87. <!-- </el-tooltip>-->
  88. <!-- </div>-->
  89. <!-- <div class="ljzcBox">-->
  90. <!-- 技术支持:城云智慧科技 | 超管解锁-->
  91. <!-- </div>-->
  92. <!-- &lt;!&ndash; <div class="ljzcBox">&ndash;&gt;-->
  93. <!-- &lt;!&ndash; 联系电话:(0510) 6661 9939&ndash;&gt;-->
  94. <!-- &lt;!&ndash; </div>&ndash;&gt;-->
  95. <!-- </div>-->
  96. <!-- </el-tab-pane>-->
  97. <!-- <el-tab-pane label="行业监管" name="行业监管">-->
  98. <!-- <div class="MsgBox">-->
  99. <!-- <div style="color: #777777;font-size: 1vw">欢迎登录</div>-->
  100. <!-- <el-form-->
  101. <!-- ref="loginForm"-->
  102. <!-- :model="loginForm"-->
  103. <!-- :rules="loginRules"-->
  104. <!-- auto-complete="on"-->
  105. <!-- class="inputBox"-->
  106. <!-- label-position="left"-->
  107. <!-- >-->
  108. <!-- <el-form-item prop="industry">-->
  109. <!-- <el-select v-model="selIndustry" placeholder="请选择行业">-->
  110. <!-- <el-option-->
  111. <!-- v-for="item in options"-->
  112. <!-- :key="item.value"-->
  113. <!-- :label="item.label"-->
  114. <!-- :value="item.value"-->
  115. <!-- />-->
  116. <!-- </el-select>-->
  117. <!-- </el-form-item>-->
  118. <!-- <el-form-item prop="username">-->
  119. <!-- <el-input-->
  120. <!-- ref="username"-->
  121. <!-- v-model="loginForm.username"-->
  122. <!-- auto-complete="on"-->
  123. <!-- placeholder="请输入用户名"-->
  124. <!-- prefix-icon="el-icon-user"-->
  125. <!-- tabindex="1"-->
  126. <!-- type="text"-->
  127. <!-- />-->
  128. <!-- </el-form-item>-->
  129. <!-- <div class="forgetBox">-->
  130. <!-- <el-form-item prop="password">-->
  131. <!-- <el-input-->
  132. <!-- ref="password"-->
  133. <!-- v-model="loginForm.password"-->
  134. <!-- auto-complete="on"-->
  135. <!-- placeholder="请输入密码"-->
  136. <!-- prefix-icon="el-icon-lock"-->
  137. <!-- show-password-->
  138. <!-- tabindex="2"-->
  139. <!-- />-->
  140. <!-- </el-form-item>-->
  141. <!-- </div>-->
  142. <!-- <div class="yzBox">-->
  143. <!-- <el-form-item prop="validateCode">-->
  144. <!-- <el-input-->
  145. <!-- ref="validateCode"-->
  146. <!-- v-model="loginForm.validateCode"-->
  147. <!-- placeholder="验证码"-->
  148. <!-- prefix-icon="el-icon-key"-->
  149. <!-- tabindex="3"-->
  150. <!-- @keyup.enter.native="handleLogin2"-->
  151. <!-- />-->
  152. <!-- </el-form-item>-->
  153. <!-- <img-->
  154. <!-- id="codeImg"-->
  155. <!-- :src="captchaImage"-->
  156. <!-- alt="点击更换"-->
  157. <!-- class="yzm"-->
  158. <!-- title="点击更换"-->
  159. <!-- @click="codeImageRefresh"-->
  160. <!-- >-->
  161. <!-- </div>-->
  162. <!-- &lt;!&ndash;记住密码 待接驳&ndash;&gt;-->
  163. <!-- <div class="remeber"><el-checkbox v-model="checked">-->
  164. <!-- <span style="font-size: 0.633vw;"> 记住密码</span>-->
  165. <!-- </el-checkbox>-->
  166. <!-- </div>-->
  167. <!-- <el-button-->
  168. <!-- class="eBtn"-->
  169. <!-- @click.native.prevent="handleLogin2"-->
  170. <!-- >登 录</el-button>-->
  171. <!-- </el-form>-->
  172. <!-- <div class="ljzcBox" style="margin-top: 1.5vw">-->
  173. <!-- &lt;!&ndash; 联系管理员 待接驳 &ndash;&gt;-->
  174. <!-- 还没有账户?-->
  175. <!-- <el-tooltip class="item" content="电话:(0510) 6661 9939" effect="dark" placement="right">-->
  176. <!-- <span class="ljzc">联系管理员</span>-->
  177. <!-- </el-tooltip>-->
  178. <!-- </div>-->
  179. <!-- <div class="ljzcBox">-->
  180. <!-- 技术支持:无锡市大数据集团有限公司-->
  181. <!-- </div>-->
  182. <!-- <div class="ljzcBox">-->
  183. <!-- 联系电话:(0510) 6661 9939-->
  184. <!-- </div>-->
  185. <!-- </div>-->
  186. <!-- </el-tab-pane>-->
  187. <!-- <el-tab-pane label="企业" name="企业">-->
  188. <!-- <div class="MsgBox">-->
  189. <!-- <div style="color: #777777;font-size: 1vw">欢迎登录</div>-->
  190. <!-- <el-form-->
  191. <!-- ref="loginForm"-->
  192. <!-- :model="loginForm"-->
  193. <!-- :rules="loginRules"-->
  194. <!-- auto-complete="on"-->
  195. <!-- class="inputBox"-->
  196. <!-- label-position="left"-->
  197. <!-- >-->
  198. <!-- <el-form-item prop="industry">-->
  199. <!-- <el-select v-model="selIndustry" placeholder="请选择">-->
  200. <!-- <el-option-->
  201. <!-- v-for="item in options"-->
  202. <!-- :key="item.value"-->
  203. <!-- :label="item.label"-->
  204. <!-- :value="item.value"-->
  205. <!-- />-->
  206. <!-- </el-select>-->
  207. <!-- </el-form-item>-->
  208. <!-- <el-button-->
  209. <!-- class="eBtn"-->
  210. <!-- @click.native.prevent="handleLogin3"-->
  211. <!-- >去 登 录</el-button>-->
  212. <!-- </el-form>-->
  213. <!-- <div class="ljzcBox" style="margin-top: 1.5vw">-->
  214. <!-- &lt;!&ndash; 联系管理员 待接驳 &ndash;&gt;-->
  215. <!-- 还没有账户?-->
  216. <!-- <el-tooltip class="item" content="电话:(0510) 6661 9939" effect="dark" placement="right">-->
  217. <!-- <span class="ljzc">联系管理员</span>-->
  218. <!-- </el-tooltip>-->
  219. <!-- </div>-->
  220. <!-- <div class="ljzcBox">-->
  221. <!-- 技术支持:无锡市大数据集团有限公司-->
  222. <!-- </div>-->
  223. <!-- <div class="ljzcBox">-->
  224. <!-- 联系电话:(0510) 6661 9939-->
  225. <!-- </div>-->
  226. <!-- </div>-->
  227. <!-- </el-tab-pane>-->
  228. <!-- </el-tabs>-->
  229. <div class="MsgBox">
  230. <div style="color: #777777;font-size: 1vw">欢迎登录</div>
  231. <el-form
  232. ref="loginForm"
  233. :model="loginForm"
  234. :rules="loginRules"
  235. auto-complete="on"
  236. class="inputBox"
  237. label-position="left"
  238. >
  239. <el-form-item prop="username">
  240. <el-input
  241. ref="username"
  242. v-model="loginForm.username"
  243. auto-complete="on"
  244. placeholder="请输入用户名"
  245. prefix-icon="el-icon-user"
  246. tabindex="1"
  247. type="text"
  248. />
  249. </el-form-item>
  250. <div class="forgetBox">
  251. <el-form-item prop="password">
  252. <el-input
  253. ref="password"
  254. v-model="loginForm.password"
  255. auto-complete="on"
  256. placeholder="请输入密码"
  257. prefix-icon="el-icon-lock"
  258. show-password
  259. tabindex="2"
  260. />
  261. </el-form-item>
  262. </div>
  263. <div class="yzBox">
  264. <el-form-item prop="validateCode">
  265. <el-input
  266. ref="validateCode"
  267. v-model="loginForm.validateCode"
  268. placeholder="验证码"
  269. prefix-icon="el-icon-key"
  270. tabindex="3"
  271. @keyup.enter.native="handleLogin"
  272. />
  273. </el-form-item>
  274. <img
  275. id="codeImg"
  276. :src="captchaImage"
  277. alt="点击更换"
  278. class="yzm"
  279. title="点击更换"
  280. @click="codeImageRefresh"
  281. >
  282. </div>
  283. <!--记住密码 待接驳-->
  284. <div class="remeber"><el-checkbox v-model="checked">
  285. <span style="font-size: 0.633vw;"> 记住密码</span>
  286. </el-checkbox>
  287. </div>
  288. <el-button
  289. class="eBtn"
  290. @click.native.prevent="handleLogin"
  291. >登 录</el-button>
  292. </el-form>
  293. <div class="ljzcBox" style="margin-top: 1.5vw">
  294. <!-- 联系管理员 待接驳 -->
  295. 还没有账户?
  296. <el-tooltip class="item" content="电话:(0510) 6661 9939" effect="dark" placement="right">
  297. <span class="ljzc">联系管理员</span>
  298. </el-tooltip>
  299. </div>
  300. <div class="ljzcBox">
  301. 技术支持:城云智慧科技 | 超管解锁
  302. </div>
  303. <!-- <div class="ljzcBox">-->
  304. <!-- 联系电话:(0510) 6661 9939-->
  305. <!-- </div>-->
  306. </div>
  307. </div>
  308. </div>
  309. <!-- <div class="linkBody">-->
  310. <!-- <span style="margin-bottom: 0.5vw;padding: 0 0.7vw;">链接: </span>-->
  311. <!-- <div>-->
  312. <!-- <span-->
  313. <!-- v-for="(item,index) in linkList"-->
  314. <!-- :key="index"-->
  315. <!-- :class="isSel == index?'selLink':'linkItem'"-->
  316. <!-- :style="{'border-right':index==linkList.length-1?'': '2px solid rgba(255, 255, 255, 0.30)'}"-->
  317. <!-- @click="urlToScene(item,index)"-->
  318. <!-- >-->
  319. <!-- {{ item.name }}-->
  320. <!-- </span>-->
  321. <!-- <span class="linkItem" @click="adminUnlock">超管账号解锁</span>-->
  322. <!-- </div>-->
  323. <!-- </div>-->
  324. <!-- <div class="idea">Copyright@Idea-sf.com</div>-->
  325. <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogPWDVisible" height="50vw" title="修改密码" top="3.125vw" width="50vw">
  326. <update-password :info="'您还未初始化密码,请初始化并重新登录'" @closeUpdate="dialogPWDVisible=false" />
  327. </el-dialog>
  328. </div>
  329. </template>
  330. <script>
  331. import Cookie from 'js-cookie'
  332. import CryptoJS from 'crypto-js'
  333. import UpdatePassword from '../components/updatePassword'
  334. import axios from 'axios'
  335. export default {
  336. name: 'Login',
  337. components: {
  338. UpdatePassword
  339. },
  340. data() {
  341. const validateUsername = (rule, value, callback) => {
  342. if (value.length < 1) {
  343. callback(new Error('请输入用户名'))
  344. } else {
  345. callback()
  346. }
  347. }
  348. const validatePassword = (rule, value, callback) => {
  349. if (value.length < 4) {
  350. callback(new Error('密码不可小于4位'))
  351. } else {
  352. callback()
  353. }
  354. }
  355. return {
  356. okRes: '',
  357. isSel: 0,
  358. linkList: [
  359. { name: '燃气专项', code: '0' },
  360. { name: '内涝专项', code: '1' },
  361. { name: '供水专项', code: '2' },
  362. { name: '道路专项', code: '6' },
  363. { name: '桥梁专项', code: '5' },
  364. { name: '地下管线专项', code: '4' },
  365. { name: '第三方施工破坏专项', code: '3' }
  366. ],
  367. activeName: '领导小组',
  368. checked: true,
  369. dialogPWDVisible: false,
  370. loginForm: {
  371. username: '',
  372. password: '',
  373. validateCode: '',
  374. url: 'login'
  375. },
  376. selIndustry: '',
  377. options: [{
  378. value: '0',
  379. label: '燃气'
  380. }, {
  381. value: '1',
  382. label: '内涝'
  383. }, {
  384. value: '2',
  385. label: '供水'
  386. }, {
  387. value: '6',
  388. label: '道路'
  389. }, {
  390. value: '5',
  391. label: '桥梁'
  392. }, {
  393. value: '4',
  394. label: '地下管线'
  395. }, {
  396. value: '3',
  397. label: '第三方施工'
  398. }
  399. ],
  400. loginRules: {
  401. username: [
  402. {
  403. required: true,
  404. trigger: 'blur',
  405. validator: validateUsername
  406. }
  407. ],
  408. password: [
  409. {
  410. required: true,
  411. trigger: 'blur',
  412. validator: validatePassword
  413. }
  414. ],
  415. validateCode: [
  416. { required: true, trigger: 'blur', message: '请输入验证码' }
  417. ]
  418. },
  419. loading: false,
  420. redirect: undefined,
  421. captchaImage: this.$constant.BASE_URI + '/captcha/captchaImage?type=math',
  422. urlList: []
  423. }
  424. },
  425. watch: {
  426. $route: {
  427. handler: function(route) {
  428. this.redirect = route.query && route.query.redirect
  429. },
  430. immediate: true
  431. }
  432. },
  433. mounted() {
  434. // 记住密码
  435. this.getUserLoginFrom()
  436. // this.getScene()
  437. this.$common.setUserType('1')
  438. this.$store.dispatch('user/cleanCache')
  439. },
  440. methods: {
  441. getScene() {
  442. const _this = this
  443. // 获取专项的路由
  444. this.$channel.globeRequest('wx/ThirdPartyStageRouteController', 'listAll', {}, 'project').then(res => {
  445. console.log('res', res)
  446. _this.urlList = res.data
  447. }).catch((e) => {
  448. console.log('异常错误', e)
  449. })
  450. },
  451. urlToScene(item, index) {
  452. // 链接到指定专项
  453. this.isSel = index
  454. if (this.urlList) {
  455. for (let i = 0; i < this.urlList.length; i++) {
  456. if (this.urlList[i].scene == item.code) {
  457. this.pushRouter(this.urlList[i].routeUrl)
  458. break
  459. }
  460. }
  461. }
  462. },
  463. // 页面跳转//设置成已读
  464. pushRouter(urlM) {
  465. console.log('页面跳转地址', urlM)
  466. // // this.$router.push()
  467. // window.open(window.location.origin + '/lifeline/#' + urlM)
  468. window.open(urlM)
  469. },
  470. // 记住密码
  471. getUserLoginFrom() {
  472. let learnFormStr = Cookie.get('learnForm')
  473. if (learnFormStr != null && learnFormStr != '' && undefined != learnFormStr) {
  474. learnFormStr = CryptoJS.AES.decrypt(learnFormStr, 'idea').toString(CryptoJS.enc.Utf8)
  475. const learnForm = JSON.parse(learnFormStr)
  476. this.loginForm = learnForm
  477. this.loginForm.validateCode = ''
  478. } else {
  479. this.loginForm = {
  480. username: '',
  481. password: '',
  482. validateCode: '',
  483. url: 'login'
  484. }
  485. }
  486. },
  487. handleClick(e) {
  488. // console.log(e)
  489. },
  490. forgetPwd: function() {
  491. this.$alert('请致电客服: 181 6890 2013')
  492. },
  493. toXAYQD() {
  494. this.$router.push('/bizLogin')
  495. },
  496. codeImageRefresh: function() {
  497. this.captchaImage =
  498. this.$constant.BASE_URI + '/captcha/captchaImage?type=math&s=' + Math.random()
  499. },
  500. adminUnlock: function() {
  501. this.$confirm('此操作将解除admin账号登录限制, 是否继续?', '提示', {
  502. confirmButtonText: '确定',
  503. cancelButtonText: '取消',
  504. type: 'warning'
  505. }).then(() => {
  506. this.$channel.baseRequest('/wx/auth', '/adminUnlock', {}, 'User').then((res) => {
  507. this.$message({
  508. type: 'success',
  509. message: '解锁成功!'
  510. })
  511. })
  512. }).catch(() => {})
  513. },
  514. handleLogin3: function() {
  515. this.$message.error('专项企业端登录入口暂未开通,请联系管理员咨询')
  516. },
  517. handleLogin2: function() {
  518. // console.log(123)
  519. const _this = this
  520. if (!_this.selIndustry) {
  521. _this.$message.error('请选择行业')
  522. return
  523. }
  524. this.$refs.loginForm.validate(valid => {
  525. if (valid) {
  526. this.loading = true
  527. const postForm = Object.assign({}, this.loginForm)
  528. postForm.password = this.$md5(this.loginForm.password)
  529. this.$store
  530. .dispatch('user/login', postForm)
  531. .then(res => {
  532. if (res.result) {
  533. // console.log(res)
  534. // 记住密码
  535. if (this.checked) {
  536. const learnFormStr = JSON.stringify(this.loginForm)
  537. const learnForm = CryptoJS.AES.encrypt(learnFormStr, 'idea')
  538. Cookie.set('learnForm', learnForm, { expires: 3 })
  539. } else {
  540. Cookie.remove('username')
  541. }
  542. if (this.urlList) {
  543. for (let i = 0; i < this.urlList.length; i++) {
  544. if (this.urlList[i].scene == _this.selIndustry) {
  545. _this.handleTicket().then(() => {
  546. console.log('获取到ticket2_:' + this.okRes)
  547. if (this.urlList[i].routeUrl.indexOf('?') >= 0) {
  548. // console.log('this.urlList[i].routeUrl+_this.okRes', this.urlList[i].routeUrl + '&ticket=' + _this.okRes)
  549. _this.pushRouter(this.urlList[i].routeUrl + '&ticket=' + _this.okRes)
  550. } else {
  551. // console.log('this.urlList[i].routeUrl+_this.okRes', this.urlList[i].routeUrl + '?ticket=' + _this.okRes)
  552. _this.pushRouter(this.urlList[i].routeUrl + '?ticket=' + _this.okRes)
  553. }
  554. })
  555. break
  556. }
  557. }
  558. }
  559. this.$router.push({ path: '/homeLand' })
  560. // window.localStorage.setItem('mask_status', true)
  561. this.loading = false
  562. } else {
  563. this.$message(res.msg)
  564. this.loading = false
  565. this.codeImageRefresh()
  566. }
  567. })
  568. .catch(err => {
  569. if (err.isInit === '0') {
  570. this.openUpdate()
  571. }
  572. this.loading = false
  573. this.codeImageRefresh()
  574. })
  575. } else {
  576. // console.log('error submit!!')
  577. return false
  578. }
  579. })
  580. },
  581. // 获取用户信息的ticket值 例如http://2.21.138.145:8086/map?ticket=1270707643224162304
  582. handleTicket() {
  583. const config = {
  584. headers: {
  585. 'MVVM-Key': String(new Date().getTime()),
  586. 'xx': 'anything',
  587. 'Referer': '1',
  588. 'Auth': '492ebbf13cc378f4d73e2ed83f4712ab',
  589. 'timestamp': '1111'
  590. }
  591. }
  592. console.log('this.$common.currUser()', this.$common.currUser())
  593. return axios.post(this.$constant.BASE_URI + '/wx/singleLoginThirdParty/getTicket?userId=' + this.$common.currUser().id, { userId: this.$common.currUser().id }, config)
  594. .then(response => {
  595. // console.log("获取——:", response);
  596. this.okRes = response.data.data
  597. // console.log('获取到ticket_:' + this.okRes)
  598. // this.isOk = true
  599. }).catch((err, x) => {
  600. // console.log("捕捉到异常!", err)
  601. })
  602. },
  603. handleLogin: function() {
  604. // console.log(123)
  605. const _this = this
  606. this.$refs.loginForm.validate(valid => {
  607. if (valid) {
  608. this.loading = true
  609. const postForm = Object.assign({}, this.loginForm)
  610. postForm.password = this.$md5(this.loginForm.password)
  611. this.$store
  612. .dispatch('user/login', postForm)
  613. .then(res => {
  614. if (res.result) {
  615. // console.log(res)
  616. // 记住密码
  617. if (this.checked) {
  618. const learnFormStr = JSON.stringify(this.loginForm)
  619. const learnForm = CryptoJS.AES.encrypt(learnFormStr, 'idea')
  620. Cookie.set('learnForm', learnForm, { expires: 3 })
  621. } else {
  622. Cookie.remove('username')
  623. }
  624. this.$router.push({ path: '/homeLand' })
  625. // window.localStorage.setItem('mask_status', true)
  626. this.loading = false
  627. } else {
  628. this.$message(res.msg)
  629. this.loading = false
  630. this.codeImageRefresh()
  631. }
  632. })
  633. .catch(err => {
  634. if (err.isInit === '0') {
  635. this.openUpdate()
  636. }
  637. this.loading = false
  638. this.codeImageRefresh()
  639. })
  640. } else {
  641. // console.log('error submit!!')
  642. return false
  643. }
  644. })
  645. },
  646. openUpdate: function() {
  647. this.dialogPWDVisible = true
  648. },
  649. closeUpdate: function() {
  650. this.dialogPWDVisible = false
  651. }
  652. }
  653. }
  654. </script>
  655. <style lang="scss">
  656. .newLogin {
  657. width: 100%;
  658. height: 56.25vw;
  659. background: url("../../static/images/loginBg.png") no-repeat;
  660. background-size: 100%;
  661. .QRcodeBody{
  662. width: 46.875vw;
  663. position: relative;
  664. top: 27.3vw;
  665. display: flex;
  666. flex-direction: column;
  667. align-items: center;
  668. .QRcode{
  669. width: 7.81vw;
  670. height: 7.81vw;
  671. }
  672. .qrInfo{
  673. font-size: 0.8333vw;
  674. color: #FFFFFF;
  675. margin-top: 0.5vw;
  676. }
  677. }
  678. .logoBox {
  679. display: flex;
  680. align-items: center;
  681. color: white;
  682. font-size: 2.45vw;
  683. font-family: pmzd;
  684. white-space: nowrap;
  685. position: absolute;
  686. left: 2.6vw;
  687. top: 2.6vw;
  688. .logo{
  689. width: 2.8vw;
  690. height: 2.8vw;
  691. }
  692. }
  693. .loginBox {
  694. position: relative;
  695. left: 50%;
  696. top: 13.02vw;
  697. margin-left: -20.8vw;
  698. width: 41.6666vw;
  699. height: 26.04vw;
  700. //box-shadow: 0px 3px 8px 1px rgba(0, 0, 0, 0.08);
  701. .xaxt {
  702. position: absolute;
  703. left: -2.4vw;
  704. width: 23.177vw;
  705. }
  706. .objectName{
  707. color: #0D2F76;
  708. font-family: pmzd;
  709. white-space: nowrap;
  710. position: absolute;
  711. font-size: 2vw;
  712. left: 77.5%;
  713. top: -2.5vw;
  714. }
  715. .MsgBox {
  716. width: 30.7vw;
  717. left: 0;
  718. top: 1.5vw;
  719. position: absolute;
  720. }
  721. .MsgTit {
  722. span {
  723. cursor: pointer;
  724. }
  725. .selectBox {
  726. display: flex;
  727. align-items: center;
  728. flex-direction: column;
  729. .select {
  730. color: rgba(42, 57, 128, 1);
  731. padding-bottom: 4px;
  732. }
  733. .line {
  734. width: 2.5vw;
  735. height: 3.5px;
  736. background: rgba(42, 57, 128, 1);
  737. border-radius: 3px;
  738. }
  739. }
  740. .unselect:hover {
  741. color: rgba(199, 25, 31, 1);
  742. }
  743. }
  744. .inputBox {
  745. .el-input {
  746. margin-top: 1vw;
  747. }
  748. .el-button {
  749. width: 30.7vw;
  750. padding: 1.5vw 0 !important;
  751. font-size: 1.07vw;
  752. letter-spacing: 0.5vw;
  753. text-indent: 0.5vw;
  754. color: white;
  755. background: #0D2F76;
  756. margin-top: 0.5vw;
  757. }
  758. .forgetBox {
  759. position: relative;
  760. }
  761. .forget {
  762. position: absolute;
  763. z-index: 5;
  764. color: rgba(199, 25, 31, 1);
  765. right: 5px;
  766. top: 100%;
  767. margin-top: 1.5vw;
  768. font-size: 0.6vw;
  769. cursor: pointer;
  770. z-index: 10;
  771. }
  772. .yzBox {
  773. position: relative;
  774. .el-input {
  775. width: 67% !important;
  776. }
  777. }
  778. .yzm {
  779. width: 9.5vw;
  780. height: 100%;
  781. position: absolute;
  782. z-index: 5;
  783. right: 0px;
  784. top: 24%;
  785. cursor: pointer;
  786. font-size: 0.6vw;
  787. }
  788. }
  789. .ljzcBox {
  790. width: 100%;
  791. text-align: center;
  792. margin-top: 1.2vw;
  793. font-size: 0.7vw;
  794. color: #999999;
  795. white-space: nowrap;
  796. .ljzc {
  797. color: #3F6AFF;
  798. cursor: pointer;
  799. }
  800. }
  801. }
  802. .idea {
  803. position: absolute;
  804. width: 500px;
  805. left: 50%;
  806. margin-left: -250px;
  807. text-align: center;
  808. color: rgba(153, 153, 153, 1);
  809. font-size: 0.4vw;
  810. bottom: 2vw;
  811. }
  812. .el-form-item {
  813. margin-bottom: 1.1vw !important;
  814. width: 30.7vw !important;
  815. height: 4.1vw !important;
  816. }
  817. .el-input__inner {
  818. height: 4vw !important;
  819. border: 1px solid rgba(51, 51, 51, 1);
  820. font-size: 1vw !important;
  821. }
  822. .remeber{
  823. margin: 2vw 0 0.5vw 0vw;
  824. font-size: 0.8333vw;
  825. }
  826. .eBtn{
  827. border-radius: 0.5vw;
  828. }
  829. .el-form-item__error{
  830. font-size: 0.65vw;
  831. }
  832. .el-input__icon{
  833. width: 1.5vw;
  834. height: 1.5vw;
  835. line-height: 4vw;
  836. }
  837. .el-checkbox__inner{
  838. width: 0.8vw;
  839. height: 0.8vw;
  840. }
  841. @media (max-width: 1300px) {
  842. .el-form-item__error {
  843. padding-top: 0 !important;
  844. }
  845. }
  846. @media (max-width: 1170px) {
  847. .el-form-item__error {
  848. display: none !important;
  849. }
  850. .inputBox {
  851. .yzm {
  852. width: 9.5vw;
  853. height: 100%;
  854. position: absolute;
  855. z-index: 5;
  856. right: 0px;
  857. top: 24%;
  858. cursor: pointer;
  859. font-size: 0.6vw;
  860. }
  861. }
  862. }
  863. @media (max-width: 1000px) {
  864. .forget {
  865. margin-top: 0.5vw !important;
  866. }
  867. }
  868. .tabBody{
  869. width: 30vw;
  870. position: absolute;
  871. left: 57%;
  872. top: 1.5vw;
  873. .el-tabs__item{
  874. font-size: 0.9vw;
  875. color: rgba(153, 153, 153, 1);
  876. height: 1.5vw;
  877. line-height:1vw;
  878. padding-left:3.5vw !important;
  879. padding-right: 3.5vw;
  880. }
  881. .el-tabs__nav{
  882. width: 100%;
  883. }
  884. .el-tabs__nav-wrap::after{
  885. width: 100%;
  886. height: 0.2vw;
  887. background: rgba(217, 217, 217, 1);
  888. }
  889. .el-tabs__active-bar{
  890. height: 0.2vw;
  891. background: rgba(16, 62, 160, 1);
  892. width: 10vw !important;
  893. left: -3.4vw;
  894. }
  895. .el-tabs__item.is-active{
  896. color: rgba(16, 62, 160, 1);
  897. }
  898. .el-tabs__content{
  899. overflow: visible;
  900. }
  901. }
  902. .el-select__caret{
  903. position: absolute;
  904. top: 1.25vw;
  905. right: 0.1vw;
  906. color: rgba(51, 51, 51, 1);
  907. }
  908. .el-icon-arrow-up:before{
  909. position: absolute;
  910. top: -1.25vw;
  911. left: 0.2vw;
  912. }
  913. .linkBody{
  914. font-size: 0.8vw;
  915. color: white;
  916. display: flex;
  917. flex-direction: column;
  918. position: absolute;
  919. left: 50px;
  920. bottom: 60px;
  921. .selLink{
  922. color: rgba(251, 142, 5, 1);
  923. cursor: pointer;
  924. padding: 0 0.7vw;
  925. }
  926. .linkItem{
  927. cursor: pointer;
  928. padding: 0 0.7vw;
  929. color: rgba(255, 255, 255, 0.80);
  930. }
  931. }
  932. .f-normal{
  933. font-size: 1.2vw;
  934. margin: 0.7vw 0;
  935. }
  936. .el-dialog__title{
  937. font-size: 1.2vw;
  938. }
  939. .el-dialog__body{
  940. //height: 30vw;
  941. padding: 1.5vw 1.2vw;
  942. }
  943. .el-dialog__title{
  944. line-height: 1.5vw;
  945. }
  946. .el-dialog__footer{
  947. padding: 1vw 0.5vw;
  948. }
  949. .el-dialog__header{
  950. padding: 1vw 0.5vw;
  951. }
  952. .el-card__body{
  953. padding: 1vw;
  954. }
  955. }
  956. .el-select-dropdown__item{
  957. font-size: 0.75vw;
  958. padding: 0.5vw;
  959. height: 2vw;
  960. line-height: 1vw;
  961. }
  962. </style>