Login.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <div :class="prefixCls" class="relative w-full h-full px-4 login-main">
  3. <!-- <AppLocalePicker
  4. class="absolute text-white top-4 right-4 enter-x xl:text-gray-600"
  5. :showText="false"
  6. v-if="!sessionTimeout && showLocale"
  7. /> -->
  8. <!-- <AppDarkModeToggle class="absolute top-3 right-7 enter-x" v-if="!sessionTimeout" /> -->
  9. <span class="-enter-x xl:hidden">
  10. <AppLogo :alwaysShowTitle="true" />
  11. </span>
  12. <div class="suoyuan">公安部鉴定中心 & 江门市公安局 & 五邑大学联合实验室 | 公安部科技强警基础工作计划(2022JC13)</div>
  13. <div class="container relative h-full py-2 mx-auto sm:px-10">
  14. <div class="flex h-full">
  15. <div class="hidden min-h-full pl-4 mr-4 xl:flex xl:flex-col xl:w-5/12">
  16. <AppLogo class="-enter-x" />
  17. <div class="my-auto" style="visibility: hidden">
  18. <img
  19. :alt="title"
  20. src="../../../assets/svg/login-box-bg.svg"
  21. class="w-1/2 -mt-16 -enter-x"
  22. />
  23. <div class="mt-10 font-medium text-white -enter-x">
  24. <span class="inline-block mt-4 text-3xl"> {{ t('sys.login.signInTitle') }}</span>
  25. </div>
  26. <div class="mt-5 font-normal text-white text-md dark:text-gray-500 -enter-x">
  27. {{ t('sys.login.signInDesc') }}
  28. </div>
  29. </div>
  30. </div>
  31. <div class="flex w-full h-full py-5 xl:h-auto xl:py-0 xl:my-0 xl:w-7/12">
  32. <div
  33. :class="`${prefixCls}-form`"
  34. class="
  35. relative
  36. 2xl:left-48
  37. xl:left-16
  38. w-full
  39. px-5
  40. py-8
  41. mx-auto
  42. my-auto
  43. rounded-md
  44. shadow-md
  45. xl:ml-8
  46. 2xl:ml-16
  47. xl:bg-transparent
  48. sm:px-8
  49. xl:p-4 xl:shadow-none
  50. sm:w-4/5
  51. lg:w-3/5
  52. xl:w-auto
  53. enter-x
  54. "
  55. >
  56. <div class="title" v-if="mytitle != '江门公安'">
  57. <div class="titleText" style="font-weight: bold; letter-spacing: 12px">
  58. <div style="margin-bottom: 0">案事件实景三维重建</div>
  59. <div>及数字化建档系统</div>
  60. </div>
  61. <div class="en text-sm font-normal mb-5 titleSubtext" style="line-height: 30px; margin-bottom:24px;color:#666">
  62. <div>3D Scene Reconstruction and Digital Archiving System of Police</div>
  63. <div>Cases and Events</div>
  64. </div>
  65. </div>
  66. <div class="title" v-else>
  67. <div class="titleText" style="font-weight: bold; letter-spacing: 12px">
  68. <div style="margin-bottom: 0">江门市公安局</div>
  69. <div>警用三维实景平台</div>
  70. </div>
  71. <div class="en text-sm font-normal mb-5 titleSubtext" style="line-height: 30px; margin-bottom:24px;color:#666">
  72. <div>Three-Dimensional Police Scene Platform for Public Security</div>
  73. <div>Bureau of Jiangmen Municipality</div>
  74. </div>
  75. </div>
  76. <LoginForm />
  77. <ForgetPasswordForm />
  78. <RegisterForm />
  79. <MobileForm />
  80. <QrCodeForm />
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </template>
  87. <script lang="ts" setup>
  88. import { computed } from 'vue';
  89. import { AppLogo } from '/@/components/Application';
  90. import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application';
  91. import LoginForm from './LoginForm.vue';
  92. import ForgetPasswordForm from './ForgetPasswordForm.vue';
  93. import RegisterForm from './RegisterForm.vue';
  94. import MobileForm from './MobileForm.vue';
  95. import QrCodeForm from './QrCodeForm.vue';
  96. import { useGlobSetting } from '/@/hooks/setting';
  97. import { useI18n } from '/@/hooks/web/useI18n';
  98. import { useDesign } from '/@/hooks/web/useDesign';
  99. import { useLocaleStore } from '/@/store/modules/locale';
  100. import { useRootSetting } from '/@/hooks/setting/useRootSetting';
  101. import { useUserStoreWithOut } from '/@/store/modules/user';
  102. import { addressKey } from '/@/api/jyUserPlatform/index';
  103. import { useAppStoreWithOut } from '/@/store/modules/app';
  104. import { useMessage } from '/@/hooks/web/useMessage';
  105. const appStore = useAppStoreWithOut();
  106. defineProps({
  107. sessionTimeout: {
  108. type: Boolean,
  109. },
  110. });
  111. const { getTitle } = useRootSetting();
  112. const mytitle = computed(() => getTitle.value);
  113. const globSetting = useGlobSetting();
  114. const useUserStore = useUserStoreWithOut();
  115. const { prefixCls } = useDesign('login');
  116. const { t } = useI18n();
  117. const localeStore = useLocaleStore();
  118. const showLocale = localeStore.getShowPicker;
  119. const title = computed(() => globSetting?.title ?? '');
  120. function getUrlParams2() {
  121. const { createConfirm } = useMessage();
  122. let url = window.location.href
  123. let urlStr = url.split('?')[1]
  124. const urlSearchParams = new URLSearchParams(urlStr)
  125. const result = Object.fromEntries(urlSearchParams.entries())
  126. let address = result['key']
  127. if(address){
  128. addressKey(address).then(res => {
  129. if(res.status == 1){
  130. createConfirm({
  131. iconType: 'warning',
  132. title: '警告',
  133. content: `此平台已被禁用`,
  134. onOk: async () => {
  135. onClose()
  136. },
  137. onCancel: async () => {
  138. onClose()
  139. },
  140. });
  141. return
  142. }
  143. appStore.setTitle(res.platformName);
  144. })
  145. }
  146. }
  147. const onClose = () => {
  148. window.opener = null;
  149. window.open('about:blank', '_top')?.close();
  150. };
  151. getUrlParams2()
  152. </script>
  153. <style lang="less">
  154. @prefix-cls: ~'@{namespace}-login';
  155. @logo-prefix-cls: ~'@{namespace}-app-logo';
  156. @countdown-prefix-cls: ~'@{namespace}-countdown-input';
  157. @dark-bg: #293146;
  158. html[data-theme='dark'] {
  159. .@{prefix-cls} {
  160. background-color: @dark-bg;
  161. &::before {
  162. background-image: url(/@/assets/svg/login-bg-dark.svg);
  163. }
  164. .ant-input,
  165. .ant-input-password {
  166. background-color: #232a3b;
  167. }
  168. .ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
  169. border: 1px solid #4a5569;
  170. }
  171. &-form {
  172. background: transparent !important;
  173. }
  174. .app-iconify {
  175. color: #fff;
  176. }
  177. }
  178. input.fix-auto-fill,
  179. .fix-auto-fill input {
  180. -webkit-text-fill-color: #c9d1d9 !important;
  181. box-shadow: inherit !important;
  182. }
  183. }
  184. .title {
  185. .titleText {
  186. font-size: 40px;
  187. @media (max-width: @screen-xl) {
  188. font-size: 40px;
  189. }
  190. @media (min-width: 3000px) {
  191. font-size: 28px;
  192. }
  193. }
  194. .titleSubtext {
  195. font-size: 14px;
  196. @media (max-width: @screen-sm) {
  197. font-size: 12px;
  198. }
  199. @media (min-width: 3000px) {
  200. font-size: 12px;
  201. line-height: 20px !important;
  202. margin-bottom: 16px !important;
  203. }
  204. }
  205. }
  206. .@{prefix-cls} {
  207. min-height: 100%;
  208. overflow: hidden;
  209. @media (max-width: @screen-xl) {
  210. background-color: #293146;
  211. .@{prefix-cls}-form {
  212. background-color: #fff;
  213. }
  214. }
  215. &::before {
  216. position: absolute;
  217. top: 0;
  218. left: 0;
  219. width: 100%;
  220. height: 100%;
  221. margin-left: -48%;
  222. background-position: 100%;
  223. background-repeat: no-repeat;
  224. background-size: auto 100%;
  225. content: '';
  226. @media (max-width: @screen-xl) {
  227. display: none;
  228. }
  229. }
  230. .@{logo-prefix-cls} {
  231. position: absolute;
  232. top: 12px;
  233. height: 30px;
  234. &__title {
  235. font-size: 16px;
  236. // color: #fff;
  237. }
  238. img {
  239. width: 32px;
  240. }
  241. }
  242. .container {
  243. .@{logo-prefix-cls} {
  244. display: flex;
  245. width: 60%;
  246. height: 80px;
  247. &__title {
  248. // font-size: 24px;
  249. // color: #fff;
  250. font-size: 32px;
  251. font-family: Source Han Sans CN, Source Han Sans CN;
  252. font-weight: 500;
  253. color: #000000;
  254. line-height: 38px;
  255. }
  256. img {
  257. width: 40px;
  258. height: 40px;
  259. }
  260. }
  261. }
  262. &-sign-in-way {
  263. .anticon {
  264. font-size: 22px;
  265. color: #888;
  266. cursor: pointer;
  267. &:hover {
  268. color: @primary-color;
  269. }
  270. }
  271. }
  272. input:not([type='checkbox']) {
  273. min-width: 360px;
  274. @media (max-width: @screen-xl) {
  275. min-width: 320px;
  276. }
  277. @media (max-width: @screen-lg) {
  278. min-width: 260px;
  279. }
  280. @media (max-width: @screen-md) {
  281. min-width: 240px;
  282. }
  283. @media (max-width: @screen-sm) {
  284. min-width: 160px;
  285. }
  286. }
  287. .@{countdown-prefix-cls} input {
  288. min-width: unset;
  289. }
  290. .ant-divider-inner-text {
  291. font-size: 12px;
  292. color: @text-color-secondary;
  293. }
  294. }
  295. .login-main {
  296. background-image: url(../bg_ga.jpg);
  297. background-position: 100%;
  298. background-repeat: no-repeat;
  299. background-size: cover;
  300. }
  301. .suoyuan {
  302. position: absolute;
  303. bottom: 30px;
  304. width: 100%;
  305. font-size: 14px;
  306. font-family: Microsoft YaHei, Microsoft YaHei;
  307. font-weight: 400;
  308. color: #999999;
  309. line-height: 30px;
  310. text-align: center;
  311. }
  312. </style>