diff --git a/src/App.vue b/src/App.vue index 9315340de25d7f822617067beb47a5d4fba87822..8da352abe0dbaf0978a6f2366d1715baa8fc20e4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,6 +5,7 @@
- - 登 录 + 登 录 + + + + 还没有账号?前往注册  + - - - 还没有账号?前往注册  - -
记住密码 - 忘记密码? + 忘记密码?
@@ -74,8 +55,8 @@ import { generateRoutes } from "../router/index"; import { reactive, toRefs, ref, onBeforeMount, nextTick } from "vue"; import { ElMessage } from "element-plus"; import axios from "@/request/http.js"; -import { Encrypt } from "@/services/secret.js" -import { useStore } from "vuex" +import { Encrypt } from "@/services/secret.js"; +import { useStore } from "vuex"; const state = reactive({ loginForm: { @@ -93,127 +74,121 @@ const state = reactive({ identifyCode: "", hidePassword: true, rememberPassword: false, -}) +}); -const store = useStore() +const store = useStore(); -const loginFormRef = ref(null) +const loginFormRef = ref(null); const loginAction = () => { - if (state.rememberPassword) { - let userinfo = window.btoa( - encodeURI(`${state.loginForm.userid},${state.loginForm.password}`) - ); - setCookie("userinfo", userinfo); - } else { - clearCookie("userinfo"); - } + if (state.rememberPassword) { + let userinfo = window.btoa(encodeURI(`${state.loginForm.userid},${state.loginForm.password}`)); + setCookie("userinfo", userinfo); + } else { + clearCookie("userinfo"); + } - loginFormRef.value.validate((valid) => { - if (valid) { - axios.get( - `/apaas/system/v5/user/verifyCaptcha?id=${state.imgId}&value=${state.loginForm.yzm}` - ) - .then((res) => { - if (res.data.code == 200) { - login(); - } else { - ElMessage.error(res.data.data); - } - }); + loginFormRef.value.validate((valid) => { + if (valid) { + axios.get(`/apaas/system/v5/user/verifyCaptcha?id=${state.imgId}&value=${state.loginForm.yzm}`).then((res) => { + if (res.data.code == 200) { + login(); + } else { + ElMessage.error(res.data.data); } }); } + }); +}; const login = () => { - axios.post(`/apaas/system/v5/user/login`, { - system_account: state.loginForm.userid, - password: Encrypt(state.loginForm.password) - }) - .then(({ data }) => { - if (data.code == 200) { - getUser(); - } else { - getImg(true); - ElMessage.error(data.data); - } - }) - .catch((error) => { - console.log(error); - }); - } + axios + .post(`/apaas/system/v5/user/login`, { + system_account: state.loginForm.userid, + password: Encrypt(state.loginForm.password), + }) + .then(({ data }) => { + if (data.code == 200) { + getUser(); + } else { + getImg(true); + ElMessage.error(data.data); + } + }) + .catch((error) => { + console.log(error); + }); +}; const getUserInfo = () => { - return axios.get(`/apaas/system/v5/user/getUserInfo`); - } + return axios.get(`/apaas/system/v5/user/getUserInfo`); +}; const getMenu = (search) => { - return axios.get(`/apaas/system/v5/menu/user/tree?search=${search}`); - } + return axios.get(`/apaas/system/v5/menu/user/tree?search=${search}`); +}; const getUser = () => { - Promise.all([getUserInfo(), getMenu('dadb2d3f-e263-48d1-9389-42acb9ea49f8')]).then((res) => { - if (res[0].data.code == 200 && res[1].data.code == 200) { - let data = res[1].data.data&&res[1].data.data[0].children || []; - store.commit("setUserInfo", res[0].data.data); - // if (res.data.data.userType == 1) { - //超管 - store.commit("setMenu", data); + Promise.all([getUserInfo(), getMenu("dadb2d3f-e263-48d1-9389-42acb9ea49f8")]).then((res) => { + if (res[0].data.code == 200 && res[1].data.code == 200) { + let data = (res[1].data.data && res[1].data.data[0].children) || []; + store.commit("setUserInfo", res[0].data.data); + // if (res.data.data.userType == 1) { + //超管 + store.commit("setMenu", data); - menu.menuToRouter(data); + menu.menuToRouter(data); - store.commit("setRoute", data); + store.commit("setRoute", data); - //存储菜单对象信息 - let menuObj = {}; - getMenuObj(data, "", menuObj); - store.commit("setMenuObj", menuObj); - // } - generateRoutes(); - // this.$router.push("/"); - //跳转到工作台页面 - window.location.href = "/apaas/portal/ui/#/"; - } - }); + //存储菜单对象信息 + let menuObj = {}; + getMenuObj(data, "", menuObj); + store.commit("setMenuObj", menuObj); + // } + generateRoutes(); + // this.$router.push("/"); + //跳转到工作台页面 + window.location.href = "/apaas/portal/ui/#/"; } + }); +}; const getMenuObj = (menu, parentRowPath, menuObj) => { - menu.forEach((e, idx) => { - e.rowPath = parentRowPath + "." + idx; - menuObj[e.path] = e; - if (e.children && e.children.length) { - getMenuObj(e.children, e.rowPath, menuObj); - } - }); + menu.forEach((e, idx) => { + e.rowPath = parentRowPath + "." + idx; + menuObj[e.path] = e; + if (e.children && e.children.length) { + getMenuObj(e.children, e.rowPath, menuObj); } + }); +}; const getImg = (clearInput = false) => { - axios.get(`/apaas/system/v5/user/getCaptcha??width=240&height=32`) - .then((res) => { - if (res.data.code == 200) { - state.imgId = res.data.data.id; - state.imgSrc = res.data.data.captcha; - } - }); - if (clearInput) { - state.loginForm.yzm = ""; - } + axios.get(`/apaas/system/v5/user/getCaptcha??width=240&height=32`).then((res) => { + if (res.data.code == 200) { + state.imgId = res.data.data.id; + state.imgSrc = res.data.data.captcha; } + }); + if (clearInput) { + state.loginForm.yzm = ""; + } +}; onBeforeMount(() => { - getImg(); - if (getCookie("userinfo")) { - let userinfo = window.atob(decodeURI(getCookie("userinfo"))).split(","); + getImg(); + if (getCookie("userinfo")) { + let userinfo = window.atob(decodeURI(getCookie("userinfo"))).split(","); - state.loginForm.userid = userinfo[0]; - state.loginForm.password = userinfo[1]; - state.checked = true; + state.loginForm.userid = userinfo[0]; + state.loginForm.password = userinfo[1]; + state.checked = true; - state.rememberPassword = true; - } else { - state.checked = false; - } -}) -const {loginForm, steploginFormRules, imgId, imgSrc, identifyCode, hidePassword, rememberPassword} = toRefs(state) + state.rememberPassword = true; + } else { + state.checked = false; + } +}); +const { loginForm, steploginFormRules, imgId, imgSrc, identifyCode, hidePassword, rememberPassword } = toRefs(state); diff --git a/src/components/login-by-code.vue b/src/components/login-by-code.vue index 683c675598ae73b65aa7b879aea480284f22b175..e11d0b9547e97a56774c1880b8805c2f7a11a310 100644 --- a/src/components/login-by-code.vue +++ b/src/components/login-by-code.vue @@ -1,199 +1,198 @@ - - - - - \ No newline at end of file +} + diff --git a/src/i18n/i18n.js b/src/i18n/i18n.js index 18f9d8558cf69edb484a19fa9bf267dd644502cc..b90bd0e903704f09aa6d9d345ff22c699f94956b 100644 --- a/src/i18n/i18n.js +++ b/src/i18n/i18n.js @@ -1,4 +1,4 @@ -import {createI18n} from 'vue-i18n' +import {createI18n} from 'vue-i18n/index' import lang from './index' const i18n = createI18n({ diff --git a/src/main.js b/src/main.js index 441c4769711aab9d6e0905c74f57c384e57f828a..4e0779d05030a7657d7a3cacdf0a691cee94b785 100644 --- a/src/main.js +++ b/src/main.js @@ -27,7 +27,7 @@ import i18n from "./i18n/i18n.js"; import axios from "./request/http.js"; const createVue = createApp(App); -createVue.use(ElementPlus, { locale }); +// createVue.use(ElementPlus, { locale }); function getMsgAppid() { axios.get(`/apaas/system/v5/message/account`).then((res) => { @@ -96,12 +96,11 @@ Promise.all([getUser(), getMenu("dadb2d3f-e263-48d1-9389-42acb9ea49f8")]) // } } generateRoutes(); - - createVue.use(ElementPlus).use(store).use(router).use(i18n).use(bgui); - createVue.mount("#app"); }) - .catch(() => { - createVue.use(ElementPlus).use(store).use(router).use(i18n).use(bgui); + .catch((e) => { + console.error(e) + }).finally(() => { + createVue.use(ElementPlus, { locale }).use(store).use(router).use(i18n).use(bgui); createVue.mount("#app"); }); diff --git a/src/page/login/index.vue b/src/page/login/index.vue index 943bde972a3199c1cc90bb1db5b2f9603631bc37..906a2372b5f4ba707fc63481824689a3d2dba5ac 100644 --- a/src/page/login/index.vue +++ b/src/page/login/index.vue @@ -1,149 +1,135 @@ - - - - - \ No newline at end of file +} + diff --git a/src/page/main/config/accessRule/index.vue b/src/page/main/config/accessRule/index.vue index 921a85a8d6813d499a518334df2307f55eb3f6bb..214ade908a537fcf21d982ffbeaea961484ffb23 100644 --- a/src/page/main/config/accessRule/index.vue +++ b/src/page/main/config/accessRule/index.vue @@ -445,10 +445,10 @@ onBeforeMount(() => { border-radius: 3px; border: solid 1px #b0bee8; } - ::v-deep td { + :deep() td { padding: 9px 0 !important; } - ::v-deep .el-switch { + :deep() .el-switch { height: 20px; width: 44px; .el-switch__core { @@ -460,7 +460,7 @@ onBeforeMount(() => { } } - ::v-deep .dialog_box_detail { + :deep() .dialog_box_detail { .el-dialog__body { padding: 0 0 18px 0; height: 580px; diff --git a/src/page/main/config/loginPage/index.vue b/src/page/main/config/loginPage/index.vue index 425ce1576bab48a4d86df9f0fa4b7d0ed86e0198..2638196fbaedb59d0b5e2aef42f1aa8add9eb353 100644 --- a/src/page/main/config/loginPage/index.vue +++ b/src/page/main/config/loginPage/index.vue @@ -97,7 +97,7 @@ const rules = reactive({}); padding-left: 24px; .el-form { width: 60%; - ::v-deep .el-form-item { + :deep() .el-form-item { &:nth-of-type(1) { .el-upload--picture-card { width: 120px; @@ -112,7 +112,7 @@ const rules = reactive({}); } } } - ::v-deep .gap-title { + :deep() .gap-title { font-size: 16px; color: #202531; } diff --git a/src/page/main/config/preference/index.vue b/src/page/main/config/preference/index.vue index a3f52a542faae32c50ca6dd98b560ef76c803b1d..4de8293a786814b77f3a8ba8996872f2acc9a82b 100644 --- a/src/page/main/config/preference/index.vue +++ b/src/page/main/config/preference/index.vue @@ -254,7 +254,7 @@ const save = () => {}; .authorizeForm, .secureForm, .registerForm { - ::v-deep .el-form-item { + :deep() .el-form-item { margin-bottom: 24px; width: 750px; font-size: 14px; diff --git a/src/page/main/develop/systemApproval/approval/index.vue b/src/page/main/develop/systemApproval/approval/index.vue index 1db8a42284c1bad08f70a3c4d14d0edd67a6dbb0..3434aa80d4c4a454a0b905c18d7d3bb477e84830 100644 --- a/src/page/main/develop/systemApproval/approval/index.vue +++ b/src/page/main/develop/systemApproval/approval/index.vue @@ -248,11 +248,11 @@ const save = () => { } .approveForm { padding: 24px 24px 0 24px; - ::v-deep .el-form-item { + :deep() .el-form-item { margin-bottom: 24px; } - ::v-deep .el-form-item__label, - ::v-deep .el-radio__label { + :deep() .el-form-item__label, + :deep() .el-radio__label { color: var(--el-text-color-primary); } } diff --git a/src/page/main/log/userAccount/index.vue b/src/page/main/log/userAccount/index.vue index f99ed732590967d3fe1c7ab340b111a2441cbae8..2f7e157a943ca8364b83b560eeda23b554322cc3 100644 --- a/src/page/main/log/userAccount/index.vue +++ b/src/page/main/log/userAccount/index.vue @@ -482,10 +482,10 @@ onBeforeMount(() => { border-radius: 3px; border: solid 1px #b0bee8; } - ::v-deep td { + :deep() td { padding: 9px 0 !important; } - ::v-deep .el-switch { + :deep() .el-switch { height: 20px; width: 44px; .el-switch__core { @@ -497,7 +497,7 @@ onBeforeMount(() => { } } - ::v-deep .dialog_box_detail { + :deep() .dialog_box_detail { .el-dialog__body { padding: 0 0 18px 0; height: 580px; diff --git a/src/page/main/log/userBehavior/index.vue b/src/page/main/log/userBehavior/index.vue index f99ed732590967d3fe1c7ab340b111a2441cbae8..2f7e157a943ca8364b83b560eeda23b554322cc3 100644 --- a/src/page/main/log/userBehavior/index.vue +++ b/src/page/main/log/userBehavior/index.vue @@ -482,10 +482,10 @@ onBeforeMount(() => { border-radius: 3px; border: solid 1px #b0bee8; } - ::v-deep td { + :deep() td { padding: 9px 0 !important; } - ::v-deep .el-switch { + :deep() .el-switch { height: 20px; width: 44px; .el-switch__core { @@ -497,7 +497,7 @@ onBeforeMount(() => { } } - ::v-deep .dialog_box_detail { + :deep() .dialog_box_detail { .el-dialog__body { padding: 0 0 18px 0; height: 580px; diff --git a/src/page/registe/index.vue b/src/page/registe/index.vue index 9da7e1dacc2a4ce9981905be2bab4f46ac20fe6c..dd9bfd1d2c48e4db5cb63af2058a6f875be199e2 100644 --- a/src/page/registe/index.vue +++ b/src/page/registe/index.vue @@ -3,22 +3,16 @@
登录 - 注册 + 注册
-
业务系统注册
-
注册信息提示审批后即可登录
+
业务系统注册
+
注册信息提示审批后即可登录
- +
基础信息
@@ -35,73 +29,44 @@ style="width: 100%" /> - + - + + :value="item.id" /> - + - + - + - +
- - +
- - {{countDown > 0 ? countDown + '秒后再次获取' : '发送验证码'}} - + + {{ countDown > 0 ? countDown + "秒后再次获取" : "发送验证码" }} +
-
+
+ show-word-limit />
@@ -122,41 +86,31 @@
- + - +
- +
- - - - + style="width: 90%"> + + +
- \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 5cbf1dcee01182059ca2def7e57b88dfb2e7ed7e..72fa4c48ef18873261d6ba5ae95d11fc371a202f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -69,7 +69,7 @@ router.beforeEach((to, from, next) => { // 检查to.path是否存在于免登陆白名单 if (inWhiteList(to.path)) { - next(); + return next(); } else { // 判断是否已经登录,未登录则重定向到首页或其他页面(通过query传参记录原来的路径) // 根据配置判断是否跳转第三方登录,跳转第三方登录则不跳login