login.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809
  1. <template xmlns="">
  2. <div>
  3. <top-menu :methodType="1"></top-menu>
  4. <div>
  5. <div class="container" style="overflow: hidden">
  6. <!-- <div class="logo"></div> -->
  7. <div class="processPic">
  8. <img
  9. src="@/assets/images/process.gif"
  10. style="width: 95%; height: 100%"
  11. />
  12. </div>
  13. <!-- 登录区域 -->
  14. <!-- <div class="content" style="margin-top: 1%; margin-left: 4%"></div> -->
  15. <div class="content" style="margin-left: 6%; z-index: 1">
  16. <div class="loginLeft">
  17. <div style="width: 100%; height: 100%">
  18. <h1 style="font-size: 32px; text-align: center; margin: 0 auto">
  19. 扫码登录
  20. </h1>
  21. <div style="width: 70%; height: 70%; margin: 15px auto 0 auto">
  22. <img
  23. :src="imgData"
  24. style="width: 100%; height: 100%"
  25. @click="reflushFlag && reflushErWei()"
  26. />
  27. </div>
  28. <div style="width: 100%;height: 25%;text-align: center;margin-top: 10px;">
  29. <p style="margin-bottom: 0px">
  30. 请使用"会助理"小程序扫描二维码进入平台
  31. </p>
  32. <p style="margin-bottom: 0px">
  33. 二维码剩余有效时间:
  34. <span style="color: red">{{ effectiveTime }}</span> s
  35. </p>
  36. <!-- <el-button @click="testLogin">测试登录</el-button> -->
  37. </div>
  38. </div>
  39. </div>
  40. <div class="loginRight">
  41. <div style="width: 80%; height: 100%; margin: 60px auto">
  42. <h1 style="font-size: 32px; text-align: center; margin: 0 auto">
  43. 手机号登录
  44. </h1>
  45. <el-form
  46. ref="loginForm"
  47. :model="loginForm"
  48. :rules="LoginRules"
  49. style="margin-left: 10px; margin-top: 20px"
  50. >
  51. <!-- 账号密码登录 -->
  52. <div v-if="loginForm.loginType === 'uname'">
  53. <el-form-item prop="mobile">
  54. <el-input
  55. v-model="loginForm.mobile"
  56. type="text"
  57. auto-complete="off"
  58. placeholder="请输入手机号"
  59. @blur="moblieBlur()"
  60. resize="vertical"
  61. oninput="if(value.length>11)value=value.slice(0,11)"
  62. >
  63. <svg-icon
  64. slot="prefix"
  65. icon-class="phone"
  66. class="el-input__icon input-icon"
  67. />
  68. </el-input>
  69. </el-form-item>
  70. <el-form-item prop="password">
  71. <el-input
  72. v-model="loginForm.password"
  73. type="password"
  74. auto-complete="off"
  75. placeholder="请输入密码"
  76. @keyup.enter.native="getCode"
  77. >
  78. <svg-icon
  79. slot="prefix"
  80. icon-class="password"
  81. class="el-input__icon input-icon"
  82. />
  83. <el-checkbox
  84. slot="suffix"
  85. v-model="loginForm.rememberMe"
  86. style="float: right; right: 0px; color: #999999"
  87. >记住密码
  88. </el-checkbox>
  89. </el-input>
  90. </el-form-item>
  91. <el-form-item prop="tenantName" v-if="tenantEnable">
  92. <el-select
  93. v-model="loginForm.tenantName"
  94. placeholder="请选择机构名称"
  95. >
  96. <el-option
  97. v-for="item in options"
  98. :key="item.value"
  99. :label="item.label"
  100. :value="item.value"
  101. >
  102. </el-option>
  103. </el-select>
  104. <!-- <el-select
  105. v-model="loginForm.tenantName"
  106. filterable
  107. remote
  108. reserve-keyword
  109. placeholder="请输入机构名称"
  110. :remote-method="remoteMethod"
  111. :loading="loadingTenant"
  112. >
  113. <el-option
  114. v-for="item in options"
  115. :key="item.value"
  116. :label="item.label"
  117. :value="item.value"
  118. >
  119. </el-option>
  120. <svg-icon
  121. slot="prefix"
  122. icon-class="tree"
  123. class="el-input__icon input-icon"
  124. />
  125. </el-select> -->
  126. <!-- <el-input v-model="loginForm.tenantName" type="text" auto-complete="off" placeholder="请输入机构名称">
  127. <svg-icon slot="prefix" icon-class="tree" class="el-input__icon input-icon" />
  128. </el-input> -->
  129. </el-form-item>
  130. <el-form-item prop="verifyInCode">
  131. <el-input
  132. v-model="loginForm.verifyInCode"
  133. type="text"
  134. auto-complete="off"
  135. placeholder="请输入验证码"
  136. style="width: 60%"
  137. @keyup.enter.native="getCode"
  138. >
  139. <svg-icon
  140. slot="prefix"
  141. icon-class="question"
  142. class="el-input__icon input-icon"
  143. />
  144. </el-input>
  145. <img
  146. :src="verifyCode"
  147. style="width: 40%"
  148. @click="refreshVerifyCode()"
  149. alt="验证码"
  150. />
  151. </el-form-item>
  152. </div>
  153. <!-- 下方的登录按钮 -->
  154. <el-form-item style="width: 100%; margin-top: 30px">
  155. <el-button
  156. :loading="loading"
  157. size="medium"
  158. type="primary"
  159. style="width: 100%;height: 40px"
  160. @click.native.prevent="getCode"
  161. >
  162. <span v-if="!loading">登 录</span>
  163. <span v-else>登 录 中...</span>
  164. </el-button>
  165. </el-form-item>
  166. </el-form>
  167. </div>
  168. </div>
  169. <!-- 注册 -->
  170. <!-- <div class="rightUp">
  171. <img
  172. src="../assets/images/upRight1.png"
  173. style="width: 100%; height: 100%"
  174. />
  175. </div> -->
  176. </div>
  177. <div class="loginTitle">
  178. <span class="loginTitleStr">赋 予 装 备 智 慧 动 能 · 构 建 场 景 数 字 脉 络</span>
  179. </div>
  180. <!-- 图形验证码 -->
  181. <Verify
  182. ref="verify"
  183. :captcha-type="'blockPuzzle'"
  184. :img-size="{ width: '400px', height: '200px' }"
  185. @success="handleLogin"
  186. />
  187. </div>
  188. <div style="margin: 0 auto;width: 75%;padding: 3% 0" ref="sortableContainer">
  189. <!-- <div shadow="hover" v-for="(item,index) in [1,2,3,4,5,6]" :key="index"-->
  190. <div style="padding: 1.2%;display: inline-block;width: 33.3333%;" v-for="(item,index1) in loginModuleData" :key="index1">
  191. <div
  192. class="module-item"
  193. :style="{height: vModuleHeight +'px'}"
  194. >
  195. <div style="height: 10%;padding: 10px 10px 5px"
  196. :style="{fontSize: vModuleFontSize1 +'px'}"
  197. >
  198. {{ item.name }}
  199. </div>
  200. <div style="height: 80%;padding:10px 10px 10px">
  201. <div style="height: 85%">
  202. <img :src="item.imgUrls" width="100%" height="100%">
  203. </div>
  204. <div style="height: 15%;text-align: center;margin: 10px 0"
  205. :style="{fontSize: vModuleFontSize2 +'px'}"
  206. >
  207. {{ item.digest }}
  208. </div>
  209. </div>
  210. <div style="text-align: center;height: 10%;margin-top: 5px">
  211. <el-button size="mini" style="background: rgb(228,241,255);color: rgb(24,144,255);border: none;font-weight: 500">了解详情<i class="el-icon-arrow-right"></i></el-button>
  212. </div>
  213. </div>
  214. </div>
  215. </div>
  216. <div style="margin: 0 auto;width: 75%;padding: 0.8%">
  217. <div v-html="bottomModData.pageContent"></div>
  218. </div>
  219. <!-- footer class="footer"-->
  220. <div style="margin: 50px;text-align: center;font-size: 20px"
  221. :style="{fontSize: bottomFontSize +'px'}"
  222. >
  223. <div style="margin: 10px 0">
  224. <a style="margin: 0 15px">会山科技</a> |
  225. <a style="margin: 0 15px">版权所有</a> |
  226. <a style="margin: 0 15px">市场合作</a> |
  227. <a style="margin: 0 15px">关于会助理</a> |
  228. <a style="margin: 0 15px">使用协议</a> |
  229. <a style="margin: 0 15px">隐私条款</a>
  230. </div>
  231. <div style="margin: 20px 0">
  232. {{ version }} <span style="margin-left: 30px">开发者:会山科技</span>
  233. </div>
  234. <div style="margin: 10px 0">
  235. 沪 I C P 备 1 9 0 0 7 0 6 1 号 - 1
  236. </div>
  237. Copyright © 2023-2024 willalp.com All Rights Reserved.
  238. </div>
  239. </div>
  240. </div>
  241. </template>
  242. <script>
  243. import {
  244. sendSmsCode,
  245. socialAuthRedirect,
  246. createLoginQrcode,
  247. getQrcodeId,
  248. checkScanStatus,
  249. loginScan,
  250. loginScanResult,
  251. getVerify
  252. } from '@/api/login'
  253. import {
  254. getTenantIdByName,
  255. getAllTenantList,
  256. getAllTenantListByPhone
  257. } from '@/api/system/tenant'
  258. import { SystemUserSocialTypeEnum } from '@/utils/constants'
  259. import { getCaptchaEnable, getTenantEnable } from '@/utils/ruoyi'
  260. import {
  261. getPassword,
  262. getRememberMe,
  263. getTenantName,
  264. getUsername,
  265. getMobile,
  266. removePassword,
  267. removeRememberMe,
  268. removeTenantName,
  269. removeUsername,
  270. setPassword,
  271. setRememberMe,
  272. setTenantId,
  273. setTenantName,
  274. setUsername,
  275. setMobile,
  276. setVerifyInCode,
  277. setCaptchaKey
  278. } from '@/utils/auth'
  279. import Verify from '@/components/Verifition/Verify'
  280. import { resetUserPwd, getUsernameByMobile } from '@/api/system/user'
  281. import topMenu from './components/login/topMenu.vue'
  282. import { getConfigData } from '@/api/infra/config'
  283. import { getLoginPagePopularizeModuleConfigPage } from '@/api/supplier/loginPagePopularizeModuleConfig'
  284. export default {
  285. name: 'Login',
  286. components: {
  287. Verify,
  288. topMenu
  289. },
  290. data() {
  291. return {
  292. bottomModData: '',
  293. loginModuleData: [],
  294. vModuleHeight: window.innerHeight * 0.45,
  295. vModuleFontSize1: window.innerHeight * 0.022,
  296. vModuleFontSize2: window.innerHeight * 0.015,
  297. bottomFontSize: window.innerHeight * 0.018,
  298. version: '会助理平台 v2.0.2 版',
  299. options: [],
  300. states: [],
  301. list: [],
  302. loadingTenant: false,
  303. verifyKey: '',
  304. verifyCode: '',
  305. reflushFlag: false,
  306. qrcodeId: '',
  307. effectiveTime: 0,
  308. imgData: null,
  309. loginT: 1,
  310. codeUrl: '',
  311. captchaEnable: true,
  312. tenantEnable: true,
  313. mobileCodeTimer: 0,
  314. loginForm: {
  315. loginType: 'uname',
  316. mobile: '',
  317. password: '',
  318. captchaVerification: '',
  319. mobileCode: '',
  320. rememberMe: false,
  321. tenantName: '',
  322. timer: null
  323. },
  324. scene: 21,
  325. LoginRules: {
  326. // username: [
  327. // { required: true, trigger: "blur", message: "用户名不能为空" },
  328. // ],
  329. verifyInCode: [
  330. { required: true, trigger: 'blur', message: '验证码不能为空' }
  331. ],
  332. password: [
  333. { required: true, trigger: 'blur', message: '密码不能为空' }
  334. ],
  335. mobile: [
  336. { required: true, trigger: 'blur', message: '手机号不能为空' },
  337. { min: 11, max: 11, message: '请输入11位手机号码', trigger: 'blur' },
  338. {
  339. validator: function(rule, value, callback) {
  340. if (/^1(2|3|4|5|7|8|9)\d{9}$/.test(value) === false) {
  341. callback(new Error('手机号格式错误'))
  342. } else {
  343. callback()
  344. }
  345. },
  346. trigger: 'blur'
  347. }
  348. ],
  349. tenantName: [
  350. { required: true, trigger: 'blur', message: '机构不能为空' },
  351. {
  352. validator: (rule, value, callback) => {
  353. // debugger
  354. getTenantIdByName(value).then((res) => {
  355. const tenantId = res.data
  356. if (tenantId && tenantId >= 0) {
  357. // 设置机构
  358. setTenantId(tenantId)
  359. callback()
  360. } else {
  361. callback('机构不存在')
  362. }
  363. })
  364. },
  365. trigger: 'blur'
  366. }
  367. ]
  368. },
  369. loading: false,
  370. redirect: undefined,
  371. // 枚举
  372. SysUserSocialTypeEnum: SystemUserSocialTypeEnum
  373. }
  374. },
  375. beforeCreate() {
  376. sessionStorage.clear()
  377. },
  378. created() {
  379. //监听窗口大小变化
  380. window.addEventListener('resize', this.adVModuleHeightHeight)
  381. getVerify().then((res) => {
  382. this.verifyCode = res.captchaImg
  383. this.verifyKey = res.captchaKey
  384. })
  385. getConfigData('login_module').then(res => {
  386. if (res.data) {
  387. this.loginModuleData = JSON.parse(res.data.value)
  388. }
  389. })
  390. // 机构开关
  391. this.tenantEnable = getTenantEnable()
  392. if (this.tenantEnable) {
  393. getTenantIdByName(this.loginForm.tenantName).then((res) => {
  394. // 设置机构
  395. const tenantId = res.data
  396. if (tenantId && tenantId >= 0) {
  397. setTenantId(tenantId)
  398. }
  399. })
  400. }
  401. // 验证码开关
  402. this.captchaEnable = getCaptchaEnable()
  403. // 重定向地址
  404. this.redirect = this.$route.query.redirect
  405. ? decodeURIComponent(this.$route.query.redirect)
  406. : undefined
  407. this.getCookie()
  408. this.generateErWeima()
  409. this.getLoginPageData('bottomMod', 3, this.bottomModData)
  410. },
  411. methods: {
  412. /** 查询列表 */
  413. getLoginPageData(parentId, type, data) {
  414. let queryParams = {
  415. type: type,
  416. parentId: parentId,
  417. status: 1
  418. }
  419. // 执行查询
  420. getLoginPagePopularizeModuleConfigPage(queryParams).then(response => {
  421. if (response.data) {
  422. switch (parentId) {
  423. case 'aboutHZL':
  424. this.aboutHZLData = response.data.list[0]
  425. break
  426. case 'bottomMod':
  427. this.bottomModData = response.data.list[0]
  428. if (this.bottomModData) {
  429. this.bottomModData.pageContent = this.bottomModData.pageContent.replace(/<img/g,
  430. '<img style=\'width:100%;height:auto;\'')
  431. }
  432. break
  433. default:
  434. response.data.list.forEach(item => {
  435. data.data.push(item)
  436. })
  437. }
  438. }
  439. })
  440. },
  441. adVModuleHeightHeight() {
  442. this.vModuleHeight = window.innerHeight * 0.45
  443. },
  444. moblieBlur() {
  445. getAllTenantListByPhone(this.loginForm.mobile).then((response) => {
  446. this.states = response.data
  447. this.list = this.states.map((item) => {
  448. return {
  449. value: `${item.name}`,
  450. label: `${item.name}`
  451. }
  452. })
  453. this.options = this.list
  454. // this.loginForm.tenantName = this.list[0].value;
  455. this.$set(this.loginForm, 'tenantName', this.list[0].value)
  456. })
  457. },
  458. /** 机构输入搜索 */
  459. remoteMethod(query) {
  460. getAllTenantListByPhone(this.loginForm.mobile).then((response) => {
  461. this.states = response.data
  462. this.list = this.states.map((item) => {
  463. return {
  464. value: `${item.name}`,
  465. label: `${item.name}`
  466. }
  467. })
  468. })
  469. if (query !== '') {
  470. this.loadingTenant = true
  471. setTimeout(() => {
  472. this.loadingTenant = false
  473. this.options = this.list.filter((item) => {
  474. return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1
  475. })
  476. }, 200)
  477. } else {
  478. this.options = []
  479. }
  480. },
  481. refreshVerifyCode() {
  482. getVerify().then((res) => {
  483. this.verifyCode = res.captchaImg
  484. this.verifyKey = res.captchaKey
  485. })
  486. },
  487. testLogin() {
  488. var testForm = {
  489. code: '0f1Qg62w3EKP313My74w3sHBVk1Qg62q',
  490. loginType: 0,
  491. mobile: '15612345678',
  492. password: 'admin123',
  493. tenantId: 1,
  494. qrcode: this.qrcodeId
  495. }
  496. loginScan(testForm).then((res) => {
  497. console.log(res.data)
  498. })
  499. },
  500. reflushErWei() {
  501. this.generateErWeima()
  502. },
  503. generateErWeima() {
  504. getQrcodeId().then((res) => {
  505. this.qrcodeId = res.data
  506. createLoginQrcode(this.qrcodeId).then((res) => {
  507. let blob = new Blob([res], {
  508. type: 'image/png'
  509. })
  510. let url = window.URL.createObjectURL(blob)
  511. // 将图片转换成img标签可以识别的url
  512. this.imgData = url
  513. //开始倒计时
  514. this.effectiveTime = 120
  515. this.timer = setInterval(() => {
  516. if (this.effectiveTime > 0) {
  517. //检查扫码登录状态
  518. checkScanStatus(this.qrcodeId).then((res) => {
  519. let scanState = res.data
  520. if (scanState == null) {
  521. this.imgData = require('@/assets/images/reflushErWei.png')
  522. this.reflushFlag = true
  523. clearInterval(this.timer)
  524. this.$modal.msgError('二维码已过期,请刷新二维码后重试')
  525. return
  526. } else if (scanState == 'yesLogin') {
  527. //获取登录信息信息后跳转页面
  528. loginScanResult(this.qrcodeId)
  529. .then((res) => {
  530. const data = res.data
  531. localStorage.clear()
  532. localStorage.setItem('ACCESS_TOKEN', data.accessToken)
  533. localStorage.setItem('REFRESH_TOKEN', data.refreshToken)
  534. localStorage.setItem('USER_ID', data.userId)
  535. localStorage.setItem('EXPIRES_TIME', data.expiresTime)
  536. this.$router.push({ path: '/' })
  537. this.effectiveTime = 0
  538. clearInterval(this.timer)
  539. })
  540. .catch(() => {
  541. this.loading = false
  542. })
  543. }
  544. })
  545. this.effectiveTime--
  546. } else {
  547. clearInterval(this.timer)
  548. this.imgData = require('@/assets/images/reflushErWei.png')
  549. this.reflushFlag = true
  550. }
  551. }, 1000)
  552. })
  553. })
  554. },
  555. getCode() {
  556. // 情况一,未开启:则直接登录
  557. if (!this.captchaEnable) {
  558. this.handleLogin({})
  559. return
  560. }
  561. // 情况二,已开启:则展示验证码;只有完成验证码的情况,才进行登录
  562. // 弹出验证码
  563. this.$refs.verify.show()
  564. },
  565. getCookie() {
  566. const username = getUsername()
  567. const password = getPassword()
  568. const rememberMe = getRememberMe()
  569. const tenantName = getTenantName()
  570. const mobile = getMobile()
  571. this.loginForm = {
  572. ...this.loginForm,
  573. username: username ? username : '',
  574. mobile: mobile ? mobile : this.loginForm.mobile,
  575. password: password ? password : this.loginForm.password,
  576. rememberMe: rememberMe ? getRememberMe() : false,
  577. tenantName: tenantName ? tenantName : this.loginForm.tenantName
  578. }
  579. },
  580. handleLogin(captchaParams) {
  581. this.$refs.loginForm.validate((valid) => {
  582. if (valid) {
  583. this.loading = true
  584. // 设置 Cookie
  585. if (this.loginForm.rememberMe) {
  586. getUsernameByMobile(this.loginForm.mobile).then((res) => {
  587. if (res.data != null) {
  588. setUsername(res.data.username)
  589. }
  590. })
  591. setMobile(this.loginForm.mobile)
  592. setPassword(this.loginForm.password)
  593. setRememberMe(this.loginForm.rememberMe)
  594. setTenantName(this.loginForm.tenantName)
  595. // setVerifyInCode(this.loginForm.verifyInCode);
  596. // setCaptchaKey(this.captchaKey);
  597. } else {
  598. removeUsername()
  599. removePassword()
  600. removeRememberMe()
  601. removeTenantName()
  602. }
  603. this.loginForm.captchaKey = this.verifyKey
  604. this.loginForm.captchaVerification =
  605. captchaParams.captchaVerification
  606. this.$store
  607. .dispatch(
  608. this.loginForm.loginType === 'sms' ? 'SmsLogin' : 'Login',
  609. this.loginForm
  610. )
  611. .then(() => {
  612. this.$router.push({ path: this.redirect || '/' }).catch(() => {
  613. })
  614. })
  615. .catch(() => {
  616. console.log('登陆失败!!!!!!!!!!!')
  617. this.refreshVerifyCode()
  618. this.loading = false
  619. })
  620. }
  621. })
  622. },
  623. async doSocialLogin(socialTypeEnum) {
  624. // 设置登录中
  625. this.loading = true
  626. let tenant = false
  627. if (this.tenantEnable) {
  628. await this.$prompt('请输入机构名称', '提示', {
  629. confirmButtonText: '确定',
  630. cancelButtonText: '取消'
  631. })
  632. .then(async({ value }) => {
  633. await getTenantIdByName(value).then((res) => {
  634. const tenantId = res.data
  635. tenant = true
  636. if (tenantId && tenantId >= 0) {
  637. setTenantId(tenantId)
  638. }
  639. })
  640. })
  641. .catch(() => {
  642. // 取消登录按钮 loading状态
  643. this.loading = false
  644. return false
  645. })
  646. } else {
  647. tenant = true
  648. }
  649. if (tenant) {
  650. // 计算 redirectUri
  651. const redirectUri =
  652. location.origin +
  653. '/social-login?' +
  654. encodeURIComponent(
  655. 'type=' +
  656. socialTypeEnum.type +
  657. '&redirect=' +
  658. (this.redirect || '/')
  659. ) // 重定向不能丢
  660. // const redirectUri = 'http://127.0.0.1:48080/api/gitee/callback';
  661. // const redirectUri = 'http://127.0.0.1:48080/api/dingtalk/callback';
  662. // 进行跳转
  663. socialAuthRedirect(
  664. socialTypeEnum.type,
  665. encodeURIComponent(redirectUri)
  666. ).then((res) => {
  667. // console.log(res.url);
  668. window.location.href = res.data
  669. })
  670. }
  671. },
  672. /** ========== 以下为升级短信登录 ========== */
  673. getSmsCode() {
  674. if (this.mobileCodeTimer > 0) return
  675. this.$refs.loginForm.validate((valid) => {
  676. if (!valid) return
  677. sendSmsCode(
  678. this.loginForm.mobile,
  679. this.scene,
  680. this.loginForm.uuid,
  681. this.loginForm.code
  682. ).then((res) => {
  683. this.$modal.msgSuccess('获取验证码成功')
  684. this.mobileCodeTimer = 60
  685. let msgTimer = setInterval(() => {
  686. this.mobileCodeTimer = this.mobileCodeTimer - 1
  687. if (this.mobileCodeTimer <= 0) {
  688. clearInterval(msgTimer)
  689. }
  690. }, 1000)
  691. })
  692. })
  693. }
  694. }
  695. }
  696. </script>
  697. <style lang="scss" scoped>
  698. @import "~@/assets/styles/login.scss";
  699. //.el-form-item {
  700. // margin-bottom: 20px !important;
  701. //}
  702. .module-item {
  703. border-radius: 10px;
  704. box-shadow: 0 0 10px #c0cfe2;
  705. /*transition: transform 0.1s ease;*/
  706. }
  707. .loginTitle {
  708. position: absolute;
  709. width: 100%;
  710. height: 100%;
  711. z-index: 0;
  712. }
  713. .loginTitleStr {
  714. position: absolute;
  715. color: #4588f6;
  716. font-size: 28px;
  717. bottom: 12%;
  718. right: 9%;
  719. }
  720. ::v-deep .el-input__inner {
  721. border-radius: 0px;
  722. border-top-width: 0px;
  723. border-left-width: 0px;
  724. border-right-width: 0px;
  725. border-bottom-width: 1px;
  726. /*outline: medium;*/
  727. }
  728. .rightUp {
  729. width: 12.3%;
  730. height: 20%;
  731. background-color: yellow;
  732. right: 0px;
  733. // z-index: 9999;
  734. position: absolute;
  735. }
  736. .loginLeft {
  737. width: 45%;
  738. height: 80%;
  739. margin: 6% 1%;
  740. float: left;
  741. // z-index: 1;
  742. border-width: 0 4px 0 0;
  743. border-style: solid;
  744. border-color: #c4cbd7;
  745. }
  746. .loginRight {
  747. width: 50%;
  748. height: 100%;
  749. margin: 1% 0;
  750. float: left;
  751. // z-index: 1;
  752. }
  753. .processPic {
  754. //margin-top: 1%;
  755. // margin-left: 3%;
  756. width: 35%;
  757. }
  758. .oauth-login {
  759. display: flex;
  760. align-items: center;
  761. cursor: pointer;
  762. }
  763. .oauth-login-item {
  764. display: flex;
  765. align-items: center;
  766. margin-right: 10px;
  767. }
  768. .oauth-login-item img {
  769. height: 25px;
  770. width: 25px;
  771. }
  772. .oauth-login-item span:hover {
  773. text-decoration: underline red;
  774. color: red;
  775. }
  776. .sms-login-mobile-code-prefix {
  777. :deep(.el-input__prefix) {
  778. top: 22%;
  779. }
  780. }
  781. .dropdown-link-text {
  782. font-size: 20px;
  783. font-weight: bold;
  784. }
  785. </style>