Ver código fonte

云南分支更新

wangfumin 4 dias atrás
pai
commit
d93b981ae8

+ 4 - 1
src/api/constant.ts

@@ -140,4 +140,7 @@ export const UPDATE_AM_MODEL = `${namespace}/caseAnimation/addOrUpdate`
 export const DELETE_AM_MODEL = `${namespace}/caseAnimation/delete`
 
 
-export const MAP_TILE_LIST = `${namespace}/notAuth/getMapConfig`
+export const MAP_TILE_LIST = `${namespace}/notAuth/getMapConfig`
+
+// 获取验证码
+export const getCode = `${namespace}/notAuth/getLoginAuthCode`

+ 2 - 1
src/components/bill-ui/components/input/richInput.vue

@@ -726,7 +726,8 @@ defineExpose({
     bottom: calc(100% + 6px);
     left: 0;
     padding: 10px;
-    width: 220px;
+    width: 320px;
+    height: 40px;
     display: flex;
     gap: 8px;
     background: rgba(27, 27, 28, 0.95);

+ 1 - 0
src/env/index.ts

@@ -89,6 +89,7 @@ export type Params = {
   share?: boolean;
   single?: boolean;
   token?: string;
+  fromRoute?: string;
 };
 
 export const baseURL = params.baseURL ? params.baseURL : "";

+ 73 - 11
src/views/login.vue

@@ -2,7 +2,7 @@
   <div class="login-layout">
     <div class="login-content">
       <div class="header">
-        <img src="/favicon.ico" />
+        <!-- <img src="/favicon.ico" /> -->
         <p>登录多元融合</p>
       </div>
 
@@ -30,6 +30,16 @@
           </template>
         </ui-input>
         <br />
+        <div class="code-row">
+          <ui-input
+            class="code-input"
+            type="text"
+            placeholder="请输入验证码"
+            v-model="code"
+          />
+          <img :src="codeImg" class="code-img" @click="refer" />
+        </div>
+        <br />
         <ui-input
           type="checkbox"
           @click.stop
@@ -40,33 +50,64 @@
         />
       </div>
       <div class="bottom">
-        <ui-button type="submit" @click="login(username, password)">登录</ui-button>
+        <ui-button type="submit" @click="login(username, password, code)">登录</ui-button>
       </div>
     </div>
   </div>
 </template>
 
 <script lang="ts" setup>
-import { ref } from "vue";
+import { ref, computed } from "vue";
 import { encodePwd } from "@/utils";
 import GAxios from "axios";
-import { fetchSetting, setToken } from "@/api";
+import { setToken } from "@/api";
 import { Message } from "bill/expose-common";
 import { params } from "@/env";
-import { GET_SETTING, UPDATE_SETTING } from "@/api/constant";
+import { GET_SETTING, getCode } from "@/api/constant";
 import { currentLayout, RoutesName } from "@/router";
 
 const username = ref(localStorage.getItem("fuse-username") || "");
 const password = ref(localStorage.getItem("fuse-password") || "");
+const code = ref("");
 const mark = ref(!!localStorage.getItem("fuse-mark"));
 const showPwd = ref(false);
-const login = (username: string, password: string) => {
+const guid = () => {
+  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
+    let r = (Math.random() * 16) | 0,
+      v = c == "x" ? r : (r & 0x3) | 0x8;
+    return v.toString(16);
+  });
+};
+// 图片验证码
+let baseURL = "https://test-mix3d.4dkankan.com";
+const imgKey = ref(guid());
+const refer = () => (imgKey.value = guid());
+if (window.location.href.indexOf("localhost") !== -1) {
+  baseURL = "https://test-mix3d.4dkankan.com";
+} else if (window.location.href.indexOf("test") !== -1) {
+  baseURL = "https://test-mix3d.4dkankan.com";
+} else {
+  baseURL = "https://mix3d.4dkankan.com";
+}
+const codeImg = computed(() => baseURL + getCode + "?key=" + imgKey.value);
+const getDeptId = () => {
+  const fromRoute = params.fromRoute;
+  if (fromRoute === "fire") return "1";
+  if (fromRoute === "cjzfire") return "DEP000011734134901809483776";
+  if (fromRoute === "xmfire") return "3";
+  if (fromRoute === "criminal") return "2";
+  return "";
+};
+const login = (username: string, password: string, code: string) => {
   if (!username) {
     return Message.error("账号不能为空");
   }
   if (!password) {
     return Message.error("密码不能为空");
   }
+  if (!code && !import.meta.env.DEV) {
+    return Message.error("验证码不能为空");
+  }
 
   const isView = [RoutesName.show, RoutesName.signModel, RoutesName.error].includes(
     currentLayout.value!
@@ -75,11 +116,13 @@ const login = (username: string, password: string) => {
   const headers = { fusionId: params.caseId, "page-type": type };
 
   GAxios.post(
-    "/fusion/login",
+    "/fusion/fdLogin",
     {
       password: encodePwd(password),
       userName: username,
-      username: username,
+      phoneNum: username,
+      code: code,
+      deptId: getDeptId(),
     },
     { headers }
   ).then(async (res) => {
@@ -114,9 +157,9 @@ const login = (username: string, password: string) => {
   });
 };
 
-if (import.meta.env.DEV) {
-  login("super-admin", "Aa123456");
-}
+// if (import.meta.env.DEV) {
+//   login("super-admin", "Aa123456", "");
+// }
 </script>
 
 <style lang="scss" scoped>
@@ -183,5 +226,24 @@ if (import.meta.env.DEV) {
     border: 1px solid var(--color-main-normal) !important;
     background: var(--color-main-normal) !important;
   }
+
+  .code-row {
+    display: flex;
+    align-items: center;
+    gap: 12px;
+    margin-top: 20px;
+  }
+
+  .code-input {
+    flex: 1;
+  }
+
+  .code-img {
+    width: 120px;
+    height: 40px;
+    cursor: pointer;
+    user-select: none;
+    flex: none;
+  }
 }
 </style>

+ 22 - 0
src/views/setting/select-back.vue

@@ -47,6 +47,24 @@
         @click="value[0] !== back.value && $emit('update:value', [back.value, null])"
       />
     </template>
+    <!-- 上传入口 -->
+      <ui-input
+        class="img-input"
+        type="file"
+        width="88px"
+        height="88px"
+        preview
+        :accept="'.png'"
+        :disable="true"
+        :multiple="false"
+        :maxSize="audioSize"
+      >
+        <template v-slot:replace>
+          <p class="audio-tip">
+            <ui-icon type="add" />
+          </p>
+        </template>
+    </ui-input>
   </div>
 </template>
 
@@ -118,6 +136,10 @@ const activeParent = computed(() => {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   gap: 20px;
+  .img-input{
+    border: 1px solid #F5F5F5;
+    border-radius: 6px;
+  }
 }
 .child-layout-parent {
   position: relative;