index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div class="authorization">
  3. <div class="leftCol">
  4. <header>
  5. <img
  6. class="logoimg"
  7. src="https://media.sxtvs.net/images/sx_logo.svg"
  8. alt="logo"
  9. />
  10. </header>
  11. <div class="body">
  12. <div class="content">
  13. <p class="title">新型全媒体平台授权登录</p>
  14. <p class="subtitle">
  15. 立足“三端”“四体”“四化”的发展思路,打造技术先进、特色突出、用户众多、自主可控的新型全媒体平台,提升主流媒体的内容生产能力、信息聚合能力和技术引领能力。
  16. </p>
  17. <img
  18. class="contentImg"
  19. src="https://home.sxtvs.net/v1/file/download?bucketName=user-app-icon&name=60f0633bc3bb11ecb0cdb1feb69f2116-secondary_background_photo%402x.jpeg"
  20. alt=""
  21. />
  22. </div>
  23. </div>
  24. </div>
  25. <div class="rightCol">
  26. <div class="model">
  27. <div class="header">账号登录</div>
  28. <el-form ref="formRef" size="large" :model="form" label-width="0">
  29. <el-form-item
  30. prop="name"
  31. :rules="[{ required: true, message: '请输入用户名' }]"
  32. >
  33. <el-input v-model="form.name" placeholder="请输入用户名" />
  34. </el-form-item>
  35. <el-form-item
  36. prop="pwd"
  37. :rules="[{ required: true, message: '请输入密码' }]"
  38. >
  39. <el-input
  40. v-model="form.pwd"
  41. show-password
  42. placeholder="请输入密码"
  43. type="password"
  44. />
  45. </el-form-item>
  46. </el-form>
  47. <el-form-item>
  48. <el-button
  49. size="large"
  50. style="width: 100%; display: block"
  51. @click="submitForm(formRef)"
  52. type="primary"
  53. >登 录</el-button
  54. >
  55. </el-form-item>
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script setup>
  61. import { onMounted, reactive, ref } from "vue";
  62. import { ElForm, ElFormItem, ElInput, ElButton } from "element-plus";
  63. import "element-plus/theme-chalk/base.css";
  64. import "element-plus/theme-chalk/el-form.css";
  65. import "element-plus/theme-chalk/el-form-item.css";
  66. import "element-plus/theme-chalk/el-input.css";
  67. import "element-plus/theme-chalk/el-button.css";
  68. import { loginIdass } from "@/api/authorization.js";
  69. // import { isIpad, isIpod, isIphone } from "../../utils/isTerminal";
  70. /**
  71. * window.$originData.orginParames.title 页面标题
  72. * window.$originData.orginParames.parameters 固定参数值
  73. * window.$originData.urlParames url参数
  74. */
  75. const formRef = ref();
  76. console.log(window.$originData);
  77. const form = reactive({
  78. name: "",
  79. pwd: "",
  80. });
  81. onMounted(() => {});
  82. const submitForm = formEl => {
  83. if (!formEl) return;
  84. formEl.validate(valid => {
  85. if (!valid) return false;
  86. loginIdass({
  87. username: form.name,
  88. password: form.pwd,
  89. }).then(res => {
  90. let url = window.$originData.urlParames.auth_url || "";
  91. if(url !== "") url += "?code=" + res.code + "&enterprise_id=" + res.enterprise_id
  92. location.href = url;
  93. });
  94. });
  95. };
  96. </script>
  97. <style lang="scss">
  98. .authorization {
  99. width: 100vw;
  100. height: 100vh;
  101. overflow: hidden;
  102. font-weight: 400;
  103. color: #545b66;
  104. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
  105. "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
  106. sans-serif;
  107. .leftCol,
  108. .rightCol {
  109. display: inline-block;
  110. height: 100%;
  111. vertical-align: top;
  112. }
  113. .leftCol {
  114. width: 60vw;
  115. background-color: #dde3f3;
  116. header {
  117. width: 100%;
  118. height: 56px;
  119. line-height: 56px;
  120. overflow: hidden;
  121. .logoimg {
  122. width: 89px;
  123. height: 28px;
  124. cursor: pointer;
  125. display: inline-block;
  126. vertical-align: middle;
  127. }
  128. .text {
  129. vertical-align: middle;
  130. display: inline-block;
  131. color: #000000;
  132. font-weight: 600;
  133. font-size: 18px;
  134. }
  135. }
  136. .body {
  137. font-size: 14px;
  138. width: 100%;
  139. height: calc(100% - 56px);
  140. text-align: center;
  141. position: relative;
  142. .content {
  143. max-width: 420px;
  144. position: relative;
  145. top: 50%;
  146. left: 50%;
  147. transform: translate(-50%, -50%);
  148. .title {
  149. font-size: 28px;
  150. color: #000000;
  151. margin-bottom: 1em;
  152. }
  153. .subtitle {
  154. line-height: 3em;
  155. }
  156. .contentImg {
  157. width: 100%;
  158. }
  159. }
  160. }
  161. }
  162. .rightCol {
  163. width: 40vw;
  164. position: relative;
  165. .model {
  166. padding: 0 3em;
  167. width: 100%;
  168. max-width: 720px;
  169. position: absolute;
  170. top: 50%;
  171. left: 50%;
  172. transform: translate(-50%, -50%);
  173. .header {
  174. font-size: 18px;
  175. font-weight: 600;
  176. height: 2em;
  177. line-height: 2em;
  178. }
  179. }
  180. }
  181. }
  182. </style>