Login.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. <template>
  2. <div>
  3. <div class="login" v-if="!bindingqywx">
  4. <div class="login-par">
  5. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="left" label-width="0px" class="demo-ruleForm login-container">
  6. <div class="login-logo">
  7. <img src="../assets/image/login_logo.png" style="width:80px;height:80px;"/>
  8. </div>
  9. <h3 class="title">{{ $t('workingHoursHousekeeper') }}</h3>
  10. <el-form-item class="login-input" prop="username">
  11. <el-input type="text" v-model="ruleForm.username" autocomplete="off" :placeholder="$t('zhang-hao-shou-ji-hao')" clearable prefix-icon="el-icon-user-solid"></el-input>
  12. </el-form-item>
  13. <el-form-item class="login-input" prop="password">
  14. <el-input type="password" v-model="ruleForm.password" @keyup.enter.native="handleSubmit" autocomplete="off" :placeholder="$t('mi-ma')" show-password prefix-icon="el-icon-lock"></el-input>
  15. </el-form-item>
  16. <el-form-item class="login-button" style="width:100%;">
  17. <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit" :loading="logining">{{ $t('login') }}</el-button>
  18. </el-form-item>
  19. <div class="additional" v-if="wxHrefFlg">
  20. <el-divider content-position="center">或</el-divider>
  21. </div>
  22. <div class="externalLanding" v-if="wxHrefFlg">
  23. <div class="externalLanding_img" @click="wxworkCli()">
  24. <img src="../assets/image/qiyeweix.png" alt="">
  25. </div>
  26. </div>
  27. <div class="toRegister">
  28. <el-link type="primary" class="btn" style="float:left;" :underline="false">{{ $t('lian-xi-ke-fu') }}
  29. <div class="service">
  30. <p style="color: #333">{{ $t('sao-ma-jia-ke-fu-wei-xin') }}</p>
  31. <img src="../assets/image/code.jpg">
  32. <p><span style="color: #333">QQ:</span><span id="QQ">3052894409</span></p>
  33. </div>
  34. </el-link>
  35. <el-link type="primary" style="margin-right:5px;" @click="dialogVisible=true" :underline="false">
  36. {{ $t('shi-yong-shuo-ming') }} </el-link>
  37. <el-link type="primary" v-if="!isCorpWX" @click="jumpTo" :underline="false">{{ $t('qi-ye-zhu-ce') }}</el-link>
  38. </div>
  39. </el-form>
  40. </div>
  41. <el-dialog :title="$t('shi-yong-shuo-ming')" :visible.sync="dialogVisible" width="500px">
  42. <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_基础版.docx" download="工时管家使用说明_基础版.docx"
  43. target="_blank">工时管家使用说明_基础版.docx</a></p>
  44. <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目管理专业版.docx" download="工时管家使用说明_项目管理专业版.docx"
  45. target="_blank">工时管家使用说明_项目管理专业版.docx</a></p>
  46. <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_建筑工程专业版.docx" download="工时管家使用说明_建筑工程专业版.docx"
  47. target="_blank">工时管家使用说明_建筑工程专业版.docx</a></p>
  48. <!-- <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_项目经理.docx" download="工时管家使用说明_项目经理.docx"
  49. target="_blank">工时管家使用说明_项目经理.docx</a></p>
  50. <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_普通员工.docx" download="工时管家使用说明_普通员工.docx"
  51. target="_blank">工时管家使用说明_普通员工.docx</a></p> -->
  52. </el-dialog>
  53. <el-dialog title="企业微信扫码登陆" :visible.sync="wxworkFlg" width="500px">
  54. <div>
  55. <div id="wxcode"></div>
  56. </div>
  57. </el-dialog>
  58. </div>
  59. <!-- 绑定企业微信的话显示这个 -->
  60. <div class="qiweix" v-if="bindingqywx">
  61. 正在进入系统...
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import * as dd from 'dingtalk-jsapi';
  67. import "../permissions.js"
  68. import WxLogin from "../assets/js/wwLogin.js"
  69. export default {
  70. inject:['reloads'],
  71. data() {
  72. return {
  73. isCorpWX: false,
  74. dialogVisible: false,
  75. logining: false,
  76. // 登录信息
  77. ruleForm: {
  78. username: '',
  79. password: ''
  80. },
  81. rules: {
  82. username: [{ required: true, message: this.$t('peaseenterthe'), trigger: 'blur' },],
  83. password: [{ required: true, message: this.$t('peaseenterthe'), trigger: 'blur' },]
  84. },
  85. wxworkFlg: false,
  86. bindingqywx: false,
  87. wxHrefFlg: false
  88. };
  89. },
  90. watch: {
  91. $route(to) {
  92. if (to.query.code) {
  93. this.getStaffInfo(to.query.code)
  94. }
  95. }
  96. },
  97. created() {
  98. // this.langChange()
  99. if (localStorage.userInfo != null) {
  100. var user = JSON.parse(localStorage.userInfo);
  101. if(user.moduleList.length > 0) {
  102. this.$router.push({ path: user.moduleList[0].path })
  103. }
  104. }
  105. let windowHerf = window.location.href
  106. if(windowHerf.indexOf('?jobNumber') != '-1') {
  107. let jobNumber = windowHerf.split('jobNumber=')[1].split('&token=')[0]
  108. let token = windowHerf.split('&token=')[1]
  109. this.automaticLogin(jobNumber, token)
  110. }
  111. // 用户绑定了企业微信 和 飞书
  112. if(windowHerf.indexOf('userId') != '-1' || windowHerf.indexOf('appId') != '-1') {
  113. this.bindingqywx = true
  114. }
  115. },
  116. mounted() {
  117. // this.wxworkCli()
  118. var ua = navigator.userAgent.toLowerCase();
  119. console.log(ua, '打印出来')
  120. if (ua.indexOf("wxwork") > 0) {
  121. this.isCorpWX = true;
  122. }
  123. let href = window.location.href;
  124. this.wxHrefFlg = href.indexOf('worktime.ttkuaiban.com') != '-1'
  125. if (this.isCorpWX) {
  126. //企业微信环境下,尝试自动登录
  127. //判断企业微信,是否存在授权
  128. //尝试自动登录
  129. if (href.indexOf('hasTriedAutoLogin') == -1) {
  130. this.tryAutoLogin();
  131. } else if (href.indexOf("userId") > 0) {
  132. //后台经过验证后,重定向过来带上了userId
  133. var loginUserId = href.substring(href.indexOf("userId=")+"userId=".length);
  134. if (loginUserId.includes('#/')) {
  135. loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
  136. }
  137. var path = null;
  138. if (href.indexOf('path') > 0) {
  139. path = href.split('path=')[1].split('&')[0];
  140. }
  141. this.loginByUserId(loginUserId, path);
  142. } else {
  143. if (localStorage.userInfo != null) {
  144. var user = JSON.parse(localStorage.userInfo);
  145. if (user.company.packageSimple == 1) {
  146. //简易模式,直接进入工时统计表
  147. this.$router.push({ path: '/simple' });
  148. } else {
  149. if(user.moduleList.length > 0) {
  150. this.$router.push({ path: user.moduleList[0].path })
  151. }
  152. }
  153. } else if (href.indexOf('errorMsg=') > 0) {
  154. var errorMsg = href.split('errorMsg=')[1].split('#')[0];
  155. errorMsg = decodeURI(errorMsg);
  156. this.$message({
  157. message: errorMsg,
  158. type: 'error'
  159. });
  160. }
  161. }
  162. } else {
  163. //浏览器上使用扫码登录
  164. if (href.indexOf("userId") > 0) {
  165. //后台经过验证后,重定向过来带上了userId
  166. var loginUserId = href.substring(href.indexOf("userId=")+"userId=".length);
  167. if (loginUserId.includes('#/')) {
  168. loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
  169. }
  170. var path = null;
  171. if (href.indexOf('path') > 0) {
  172. path = href.split('path=')[1].split('&')[0];
  173. }
  174. this.loginByUserId(loginUserId, path);
  175. } else if (localStorage.userInfo != null) {
  176. var user = JSON.parse(localStorage.userInfo);
  177. if (user.company.packageSimple == 1) {
  178. //简易模式,直接进入工时统计表
  179. this.$router.push({ path: '/simple' });
  180. } else {
  181. if(user.moduleList.length > 0) {
  182. this.$router.push({ path: user.moduleList[0].path })
  183. }
  184. }
  185. } else {
  186. if(href.indexOf("corpid") > 0) {
  187. // 钉钉登陆
  188. //检查环境,如果是钉钉有$CORPID$
  189. var key = '?corpid=';
  190. var jumpkey = '&jumpto=';
  191. var url = location.href;
  192. console.log('jumpto',location);
  193. // var url = "https://worktime.ttkuaiban.com/?corpid=$CORPID$&jumpto=/info/21#/index"
  194. var that = this;
  195. if (url.indexOf(key) > 0) {
  196. var corpId = ''
  197. var jumpurl = ''
  198. if(url.indexOf(jumpkey) > 0){
  199. corpId = url.substring(url.indexOf(key)+key.length,url.indexOf(jumpkey));
  200. jumpurl = url.substring(url.indexOf(jumpkey)+jumpkey.length,url.indexOf('#'));
  201. }else{
  202. corpId = url.substring(url.indexOf(key)+key.length,url.indexOf('#'));
  203. }
  204. dd.ready(function() {
  205. that.isDingchg()
  206. dd.runtime.permission.requestAuthCode({
  207. corpId: corpId, // 企业id
  208. onSuccess: function (info) {
  209. var code = info.code // 通过该免登授权码可以获取用户身份
  210. that.loginByCode(code, corpId, jumpurl);
  211. }});
  212. });
  213. }
  214. } else {
  215. // 飞书登陆
  216. if(href.indexOf("appId") > 0) {
  217. console.log('执行到这里---飞书')
  218. let arr = href.split('appId=')[1]
  219. let str = arr.split('#')[0]
  220. console.log(str, window)
  221. window.h5sdk.ready(() => { // ready方法不需要每次都调用
  222. tt.requestAuthCode({
  223. appId: str,
  224. success: (info) => {
  225. console.info(info.code, '飞书 code')
  226. this.flyingBook(str, info.code)
  227. },
  228. fail: (error) => {
  229. console.error(error)
  230. }
  231. });
  232. });
  233. }
  234. }
  235. }
  236. }
  237. let urls = window.location.href
  238. console.log(urls, '连接')
  239. if(urls.indexOf('english=1') != '-1' && localStorage.getItem('lang') != 'en') {
  240. this.setlangChange()
  241. location.reload()
  242. }
  243. if(urls.indexOf('english=1') == '-1' && localStorage.getItem('lang') != 'zh') {
  244. localStorage.setItem("lang", 'zh')
  245. location.reload()
  246. }
  247. },
  248. methods: {
  249. wxworkCli() {
  250. // this.wxworkFlg = true
  251. // this.$nextTick(()=>{
  252. // var obj = new WxLogin({
  253. // id: 'wxcode', // 登录页面显示二维码的容器id
  254. // appid: 'wwf11426cf618e1703', // 企业微信的CorpID,在企业微信管理端查看
  255. // redirect_uri: encodeURIComponent('http://localhost:10086/#/login'), // 重定向的地址,需要进行encode
  256. // usertype: 'member'
  257. // })
  258. // })
  259. var appId = "wwf11426cf618e1703";//企业微信第三方的SUIT ID
  260. var url = "https://worktime.ttkuaiban.com/api/corpWXScanningAuth";//授权回调页面
  261. var weixinUrl=`https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?appid=${appId}&redirect_uri=${url}&state=0&usertype=member`;
  262. window.location.href = weixinUrl;
  263. },
  264. getStaffInfo() {
  265. console.log('执行了没')
  266. },
  267. setlangChange() {
  268. localStorage.setItem("lang", 'en')
  269. },
  270. langChange() {
  271. let jsSrc =(navigator.language || navigator.browserLanguage).toLowerCase();
  272. let str = localStorage.getItem("lang")
  273. if(jsSrc.indexOf('zh')!=-1){
  274. // 浏览器语言是中文
  275. localStorage.setItem("lang", 'zh')
  276. // localStorage.setItem("lang", 'en')
  277. } else {
  278. // 浏览器语言是英文
  279. localStorage.setItem("lang", 'en')
  280. // localStorage.setItem("lang", 'zh')
  281. }
  282. if(str != localStorage.getItem("lang")) {
  283. // this.reloads()
  284. location.reload()
  285. }
  286. console.log(str, localStorage.getItem("lang"))
  287. },
  288. isDingchg() {
  289. this.$store.commit('isDingFun')
  290. },
  291. bindIfNessary() {
  292. let href = window.location.href;
  293. if (this.isCorpWX) {
  294. // localStorage.openId = 'o1L3L5lOrOl3_UEJjONaoT2Rne1I';
  295. //会自动跳转到首页
  296. // let href = 'http://hq.tangusoft.com/?code=011Ptjgc2rx1eI09Irgc2Rvsgc2PtjgF&state=1#/index';
  297. if (href.includes("com/?code")) { //url包括 com/?code 证明为从微信跳转回来的
  298. var url = href; //vue自动在末尾加了 #/ 符号,截取去掉
  299. var jingPosit = url.indexOf("com/") + 4; //获取域名结束的位置
  300. // var urlLeft = url.substring(0, jingPosit);//url左侧部分
  301. var urlRight = url.substring(jingPosit, url.length); //url右侧部分
  302. console.log('urlRight=' + urlRight);
  303. urlRight = urlRight.substring(0, urlRight.indexOf('#/'));
  304. // window.location = urlLeft + "#/home" + urlRight;//拼接跳转
  305. //获取code
  306. var code = urlRight.substring('?code='.length,urlRight.indexOf('&state='));
  307. var passUserId = urlRight.substring(urlRight.indexOf('&state=')+'&state='.length);
  308. if (passUserId == '1') {
  309. //自动登录的回调
  310. this.$axios.get('/wxcorp/corpWeiXinLogin', {params:{code:code}})
  311. .then(res => {
  312. if (res == null) {
  313. } else if(res.errcode != null) {
  314. //报错了
  315. console.log(res.errmsg);
  316. } else {
  317. //获取openId
  318. if (res.data != null && ((this.isWX && res.data.wxOpenid != undefined)
  319. || (this.isCorpWX && res.data.corpwxUserid != undefined))) {
  320. localStorage.userInfo = JSON.stringify(res.data);
  321. console.log('登录成功');
  322. this.user = res.data;
  323. this.permissionsList(res.data)
  324. window.location.href = '/#/index';
  325. }
  326. }
  327. }).catch(err=> {
  328. alert('err=' + err);
  329. });
  330. } else {
  331. }
  332. }
  333. }
  334. },
  335. tryAutoLogin() {
  336. var appId = "ww4e237fd6abb635af";//企业微信第三方的SUIT ID
  337. var url = "https://worktime.ttkuaiban.com/api/corpWXAuth";//授权回调页面
  338. var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
  339. window.location.href = weixinUrl;
  340. },
  341. loginByUserId(userId, path) {
  342. this.http.post("/user/loginByUserId", {userId:userId} , res => {
  343. if (res.code == "ok") {
  344. var user = res.data;
  345. localStorage.user = JSON.stringify(res.data);
  346. sessionStorage.setItem('user', JSON.stringify(res.data));
  347. this.permissionsList(res.data)
  348. if(user.moduleList.length > 0) {
  349. if (path) {
  350. this.$router.push({ path: path })
  351. } else {
  352. this.$router.push({ path: user.moduleList[0].path })
  353. }
  354. if (!path) {
  355. path = user.moduleList[0].path;
  356. }
  357. //去掉链接上存在的参数
  358. if (location.href.indexOf("?")>0) {
  359. var newHref = location.href.split("?")[0] + '#' + (path.indexOf('/')>-1?path:('/'+path));
  360. location.href = newHref;
  361. }
  362. }
  363. } else {
  364. this.$message({
  365. message: res.msg,
  366. type: 'error'
  367. });
  368. }
  369. }, error => {
  370. this.$message({
  371. message: error,
  372. type: 'error'
  373. });
  374. })
  375. },
  376. loginByCode(code, corpId, jumpurl) {
  377. this.http.post("/dingding/getUserByCode", {code:code, corpid:corpId} , res => {
  378. if (res.code == "ok") {
  379. var user = res.data;
  380. localStorage.user = JSON.stringify(res.data);
  381. sessionStorage.setItem('user', JSON.stringify(res.data));
  382. this.permissionsList(res.data)
  383. if(jumpurl){
  384. this.$router.push({ path: jumpurl })
  385. }else if(user.moduleList.length > 0) {
  386. this.$router.push({ path: user.moduleList[0].path })
  387. }
  388. } else {
  389. this.$message({
  390. message: res.msg,
  391. type: 'error'
  392. });
  393. }
  394. }, error => {
  395. this.$message({
  396. message: error,
  397. type: 'error'
  398. });
  399. })
  400. },
  401. handleReset2() {
  402. this.$refs.ruleForm.resetFields();
  403. },
  404. jumpTo() {
  405. this.$router.push({ path: '/register' });
  406. },
  407. handleSubmit(ev) {
  408. this.$refs.ruleForm.validate((valid) => {
  409. if (valid) {
  410. var _this = this;
  411. this.logining = true;
  412. setTimeout(function () {
  413. _this.logining = false;
  414. // console.log('执行')
  415. }, 15000);
  416. this.http.post(this.port.manage.login, this.ruleForm , res => {
  417. this.logining = false;
  418. if (res.code == "ok") {
  419. if(res.data.moduleList.length == 0){
  420. this.$message({
  421. message: this.$t('qing-lian-xi-guan-li-yuan-wei')+'\u3000' + res.data.roleName + '\u3000'+this.$t('assignpermissions'),
  422. type: 'error'
  423. })
  424. return
  425. }
  426. var user = res.data;
  427. sessionStorage.setItem('user', JSON.stringify(res.data));
  428. this.permissionsList(res.data)
  429. if (user.company.packageSimple == 1) {
  430. //简易模式,直接进入工时统计表
  431. this.$router.push({ path: '/simple' });
  432. sessionStorage.setItem('autoRoute','/simple')
  433. } else {
  434. if(user.moduleList.length > 0) {
  435. this.$router.push({ path: user.moduleList[0].path })
  436. sessionStorage.setItem('autoRoute',user.moduleList[0].path)
  437. }
  438. }
  439. } else {
  440. this.logining = false;
  441. // if(res.msg.indexOf('到期') != -1){
  442. // this.$router.push({ path: '/expire', query:{datetext:'2022.11.24',ddd: '111'}})
  443. // console.log('到期skip');
  444. // return
  445. // }
  446. this.$message({
  447. message: res.msg,
  448. type: 'error'
  449. });
  450. }
  451. }, error => {
  452. console.log('执行1')
  453. this.logining = false;
  454. this.$message({
  455. message: error,
  456. type: 'error'
  457. });
  458. })
  459. }
  460. });
  461. },
  462. // 米莱得用工号登录
  463. automaticLogin(jobNumber, token) {
  464. this.http.post('/user/loginAdminByThirdParty', {
  465. jobNumber: jobNumber,
  466. token: token
  467. } , res => {
  468. if (res.code == "ok") {
  469. if(res.data.moduleList.length == 0){
  470. this.$message({
  471. message: this.$t('qing-lian-xi-guan-li-yuan-wei')+'\u3000' + res.data.roleName + '\u3000'+this.$t('assignpermissions'),
  472. type: 'error'
  473. })
  474. return
  475. }
  476. var user = res.data;
  477. sessionStorage.setItem('user', JSON.stringify(res.data));
  478. this.permissionsList(res.data)
  479. if (user.company.packageSimple == 1) {
  480. //简易模式,直接进入工时统计表
  481. this.$router.push({ path: '/simple' });
  482. sessionStorage.setItem('autoRoute','/simple')
  483. } else {
  484. if(user.moduleList.length > 0) {
  485. this.$router.push({ path: user.moduleList[0].path })
  486. sessionStorage.setItem('autoRoute',user.moduleList[0].path)
  487. }
  488. }
  489. } else {
  490. this.$message({
  491. message: res.msg,
  492. type: 'error'
  493. });
  494. }
  495. }, error => {
  496. this.$message({
  497. message: error,
  498. type: 'error'
  499. });
  500. })
  501. },
  502. // 飞书登陆
  503. flyingBook(appid, code) {
  504. this.http.post('/feishu-info/loginByFeishu', {
  505. appId: appid,
  506. code: code
  507. } , res => {
  508. console.log(res, '接口返回')
  509. if (res.code == "ok") {
  510. var user = res.data;
  511. localStorage.user = JSON.stringify(res.data);
  512. sessionStorage.setItem('user', JSON.stringify(res.data));
  513. this.permissionsList(res.data)
  514. if(user.moduleList.length > 0) {
  515. this.$router.push({ path: user.moduleList[0].path })
  516. }
  517. } else {
  518. this.$message({
  519. message: res.msg,
  520. type: 'error'
  521. });
  522. }
  523. }, error => {
  524. console.log(error, '抛出异常')
  525. this.$message({
  526. message: error,
  527. type: 'error'
  528. });
  529. })
  530. },
  531. // 权限控制
  532. permissionsList(item) {
  533. var arr = []
  534. var ss = item.functionList
  535. for(var i in ss) {
  536. arr.push(ss[i].name)
  537. }
  538. var ssAkl = this.StringUtil.permissions(arr)
  539. sessionStorage.setItem('permissions', JSON.stringify(ssAkl));
  540. // console.log(ssAkl, '返回过来的数据原--------')
  541. },
  542. },
  543. }
  544. </script>
  545. <style lang="scss" scoped>
  546. .qiweix {
  547. width: 100%;
  548. display: flex;
  549. justify-content: center;
  550. padding: 50px 0;
  551. font-size: 40px;
  552. color: #505458;
  553. }
  554. .additional {
  555. width: 100%;
  556. text-align: center;
  557. padding: 20px 0;
  558. color: #505458;
  559. }
  560. .externalLanding {
  561. width: 100%;
  562. display: flex;
  563. justify-content: center;
  564. .externalLanding_img {
  565. width: 30px;
  566. height: 30px;
  567. border: 1px solid #409EFF;
  568. border-radius: 50%;
  569. position: relative;
  570. overflow: hidden;
  571. cursor: pointer;
  572. display: flex;
  573. justify-content: center;
  574. align-items: center;
  575. img {
  576. width: 80%;
  577. height: 80%;
  578. }
  579. }
  580. }
  581. .login {
  582. height: 100%;
  583. .login-par {
  584. width: 100%;
  585. // min-height: 100%;
  586. height: 100vh;
  587. background: #f0f2f5 url('../assets/image/background.png') no-repeat 50%;
  588. background-size: 100%;
  589. padding: 110px 0 144px;
  590. position: relative;
  591. box-sizing: border-box;
  592. .login-logo {
  593. text-align: center;
  594. margin: 0 0 20px 0;
  595. }
  596. .login-container {
  597. -webkit-border-radius: 5px;
  598. border-radius: 5px;
  599. -moz-border-radius: 5px;
  600. background-clip: padding-box;
  601. width: 315px;
  602. // height: 380px;
  603. padding: 25px 35px 25px 35px;
  604. background: #fff;
  605. border: 1px solid #eaeaea;
  606. box-shadow: 0 0 5px #cac6c6;
  607. border-top: 10px solid #20a0ff;
  608. margin:auto;
  609. .title {
  610. font-size: 20px;
  611. margin: 0px auto 40px auto;
  612. text-align: center;
  613. color: #505458;
  614. }
  615. .remember {
  616. margin: 0px 0px 35px 0px;
  617. }
  618. .login-input {
  619. margin: 30px 0 0 0;
  620. }
  621. .login-button {
  622. margin: 30px 0 0 0;
  623. }
  624. .login-button .el-button {
  625. padding: 14px;
  626. }
  627. }
  628. }
  629. }
  630. .toRegister {
  631. margin: 15px 0;
  632. text-align: right;
  633. position: relative;
  634. .service {
  635. display: none;
  636. width: 120px;
  637. position: absolute;
  638. background: #fff;
  639. text-align: center;
  640. padding: 10px;
  641. left: -30px;
  642. top: -210px;
  643. border-radius: 5px;
  644. box-shadow: 3px 3px 10px #dfdfdf;
  645. img {
  646. width: 80px;
  647. }
  648. }
  649. }
  650. .btn:hover .service {
  651. display: block;
  652. }
  653. </style>