|
@@ -2,7 +2,7 @@
|
|
|
<div class="login-layout">
|
|
<div class="login-layout">
|
|
|
<div class="login-content">
|
|
<div class="login-content">
|
|
|
<div class="header">
|
|
<div class="header">
|
|
|
- <img src="/favicon.ico" />
|
|
|
|
|
|
|
+ <!-- <img src="/favicon.ico" /> -->
|
|
|
<p>登录多元融合</p>
|
|
<p>登录多元融合</p>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -30,6 +30,16 @@
|
|
|
</template>
|
|
</template>
|
|
|
</ui-input>
|
|
</ui-input>
|
|
|
<br />
|
|
<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
|
|
<ui-input
|
|
|
type="checkbox"
|
|
type="checkbox"
|
|
|
@click.stop
|
|
@click.stop
|
|
@@ -40,33 +50,64 @@
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="bottom">
|
|
<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>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { ref } from "vue";
|
|
|
|
|
|
|
+import { ref, computed } from "vue";
|
|
|
import { encodePwd } from "@/utils";
|
|
import { encodePwd } from "@/utils";
|
|
|
import GAxios from "axios";
|
|
import GAxios from "axios";
|
|
|
-import { fetchSetting, setToken } from "@/api";
|
|
|
|
|
|
|
+import { setToken } from "@/api";
|
|
|
import { Message } from "bill/expose-common";
|
|
import { Message } from "bill/expose-common";
|
|
|
import { params } from "@/env";
|
|
import { params } from "@/env";
|
|
|
-import { GET_SETTING, UPDATE_SETTING } from "@/api/constant";
|
|
|
|
|
|
|
+import { GET_SETTING, getCode } from "@/api/constant";
|
|
|
import { currentLayout, RoutesName } from "@/router";
|
|
import { currentLayout, RoutesName } from "@/router";
|
|
|
|
|
|
|
|
const username = ref(localStorage.getItem("fuse-username") || "");
|
|
const username = ref(localStorage.getItem("fuse-username") || "");
|
|
|
const password = ref(localStorage.getItem("fuse-password") || "");
|
|
const password = ref(localStorage.getItem("fuse-password") || "");
|
|
|
|
|
+const code = ref("");
|
|
|
const mark = ref(!!localStorage.getItem("fuse-mark"));
|
|
const mark = ref(!!localStorage.getItem("fuse-mark"));
|
|
|
const showPwd = ref(false);
|
|
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) {
|
|
if (!username) {
|
|
|
return Message.error("账号不能为空");
|
|
return Message.error("账号不能为空");
|
|
|
}
|
|
}
|
|
|
if (!password) {
|
|
if (!password) {
|
|
|
return Message.error("密码不能为空");
|
|
return Message.error("密码不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!code && !import.meta.env.DEV) {
|
|
|
|
|
+ return Message.error("验证码不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
const isView = [RoutesName.show, RoutesName.signModel, RoutesName.error].includes(
|
|
const isView = [RoutesName.show, RoutesName.signModel, RoutesName.error].includes(
|
|
|
currentLayout.value!
|
|
currentLayout.value!
|
|
@@ -75,11 +116,13 @@ const login = (username: string, password: string) => {
|
|
|
const headers = { fusionId: params.caseId, "page-type": type };
|
|
const headers = { fusionId: params.caseId, "page-type": type };
|
|
|
|
|
|
|
|
GAxios.post(
|
|
GAxios.post(
|
|
|
- "/fusion/login",
|
|
|
|
|
|
|
+ "/fusion/fdLogin",
|
|
|
{
|
|
{
|
|
|
password: encodePwd(password),
|
|
password: encodePwd(password),
|
|
|
userName: username,
|
|
userName: username,
|
|
|
- username: username,
|
|
|
|
|
|
|
+ phoneNum: username,
|
|
|
|
|
+ code: code,
|
|
|
|
|
+ deptId: getDeptId(),
|
|
|
},
|
|
},
|
|
|
{ headers }
|
|
{ headers }
|
|
|
).then(async (res) => {
|
|
).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>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -183,5 +226,24 @@ if (import.meta.env.DEV) {
|
|
|
border: 1px solid var(--color-main-normal) !important;
|
|
border: 1px solid var(--color-main-normal) !important;
|
|
|
background: 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>
|
|
</style>
|