Login.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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. const appStore = useAppStoreWithOut();
  105. defineProps({
  106. sessionTimeout: {
  107. type: Boolean,
  108. },
  109. });
  110. const { getTitle } = useRootSetting();
  111. const mytitle = computed(() => getTitle.value);
  112. const globSetting = useGlobSetting();
  113. const useUserStore = useUserStoreWithOut();
  114. const { prefixCls } = useDesign('login');
  115. const { t } = useI18n();
  116. const localeStore = useLocaleStore();
  117. const showLocale = localeStore.getShowPicker;
  118. const title = computed(() => globSetting?.title ?? '');
  119. function getUrlParams2() {
  120. let url = window.location.href
  121. let urlStr = url.split('?')[1]
  122. const urlSearchParams = new URLSearchParams(urlStr)
  123. const result = Object.fromEntries(urlSearchParams.entries())
  124. let address = result['key']
  125. if(address){
  126. addressKey(address).then(res => {
  127. if(res.status == 1){
  128. createConfirm({
  129. iconType: 'warning',
  130. title: '警告',
  131. content: `此平台已被禁用`,
  132. onOk: async () => {
  133. onClose()
  134. },
  135. onCancel: async () => {
  136. onClose()
  137. },
  138. });
  139. return
  140. }
  141. appStore.setTitle(res.platformName);
  142. })
  143. }
  144. }
  145. const onClose = () => {
  146. window.opener = null;
  147. window.open('about:blank', '_top')?.close();
  148. };
  149. getUrlParams2()
  150. </script>
  151. <style lang="less">
  152. @prefix-cls: ~'@{namespace}-login';
  153. @logo-prefix-cls: ~'@{namespace}-app-logo';
  154. @countdown-prefix-cls: ~'@{namespace}-countdown-input';
  155. @dark-bg: #293146;
  156. html[data-theme='dark'] {
  157. .@{prefix-cls} {
  158. background-color: @dark-bg;
  159. &::before {
  160. background-image: url(/@/assets/svg/login-bg-dark.svg);
  161. }
  162. .ant-input,
  163. .ant-input-password {
  164. background-color: #232a3b;
  165. }
  166. .ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
  167. border: 1px solid #4a5569;
  168. }
  169. &-form {
  170. background: transparent !important;
  171. }
  172. .app-iconify {
  173. color: #fff;
  174. }
  175. }
  176. input.fix-auto-fill,
  177. .fix-auto-fill input {
  178. -webkit-text-fill-color: #c9d1d9 !important;
  179. box-shadow: inherit !important;
  180. }
  181. }
  182. .title {
  183. .titleText {
  184. font-size: 40px;
  185. @media (max-width: @screen-xl) {
  186. font-size: 40px;
  187. }
  188. }
  189. .titleSubtext {
  190. font-size: 14px;
  191. @media (max-width: @screen-sm) {
  192. font-size: 12px;
  193. }
  194. }
  195. }
  196. .@{prefix-cls} {
  197. min-height: 100%;
  198. overflow: hidden;
  199. @media (max-width: @screen-xl) {
  200. background-color: #293146;
  201. .@{prefix-cls}-form {
  202. background-color: #fff;
  203. }
  204. }
  205. &::before {
  206. position: absolute;
  207. top: 0;
  208. left: 0;
  209. width: 100%;
  210. height: 100%;
  211. margin-left: -48%;
  212. background-position: 100%;
  213. background-repeat: no-repeat;
  214. background-size: auto 100%;
  215. content: '';
  216. @media (max-width: @screen-xl) {
  217. display: none;
  218. }
  219. }
  220. .@{logo-prefix-cls} {
  221. position: absolute;
  222. top: 12px;
  223. height: 30px;
  224. &__title {
  225. font-size: 16px;
  226. // color: #fff;
  227. }
  228. img {
  229. width: 32px;
  230. }
  231. }
  232. .container {
  233. .@{logo-prefix-cls} {
  234. display: flex;
  235. width: 60%;
  236. height: 80px;
  237. &__title {
  238. // font-size: 24px;
  239. // color: #fff;
  240. font-size: 32px;
  241. font-family: Source Han Sans CN, Source Han Sans CN;
  242. font-weight: 500;
  243. color: #000000;
  244. line-height: 38px;
  245. }
  246. img {
  247. width: 40px;
  248. height: 40px;
  249. }
  250. }
  251. }
  252. &-sign-in-way {
  253. .anticon {
  254. font-size: 22px;
  255. color: #888;
  256. cursor: pointer;
  257. &:hover {
  258. color: @primary-color;
  259. }
  260. }
  261. }
  262. input:not([type='checkbox']) {
  263. min-width: 360px;
  264. @media (max-width: @screen-xl) {
  265. min-width: 320px;
  266. }
  267. @media (max-width: @screen-lg) {
  268. min-width: 260px;
  269. }
  270. @media (max-width: @screen-md) {
  271. min-width: 240px;
  272. }
  273. @media (max-width: @screen-sm) {
  274. min-width: 160px;
  275. }
  276. }
  277. .@{countdown-prefix-cls} input {
  278. min-width: unset;
  279. }
  280. .ant-divider-inner-text {
  281. font-size: 12px;
  282. color: @text-color-secondary;
  283. }
  284. }
  285. .login-main {
  286. background-image: url(../bg_ga.jpg);
  287. background-position: 100%;
  288. background-repeat: no-repeat;
  289. background-size: cover;
  290. }
  291. .suoyuan {
  292. position: absolute;
  293. bottom: 30px;
  294. width: 100%;
  295. font-size: 14px;
  296. font-family: Microsoft YaHei, Microsoft YaHei;
  297. font-weight: 400;
  298. color: #999999;
  299. line-height: 30px;
  300. text-align: center;
  301. }
  302. </style>