Commit e887ae72 authored by 赵伟庚's avatar 赵伟庚

登录跳转首页;密码框明文密文切换;更换菜单id;注释消息中心sdk

parent 6621cf06
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
}, },
userInfo: { userInfo: {
handler() { handler() {
this.initMsg(); // this.initMsg();
}, },
deep: true, deep: true,
}, },
...@@ -126,6 +126,8 @@ export default { ...@@ -126,6 +126,8 @@ export default {
this.readFlag = !this.readFlag; this.readFlag = !this.readFlag;
}, },
initMsg() { initMsg() {
console.log(this.userInfo);
console.log(this.$trace);
if (this.userInfo && this.userInfo.system_id) { if (this.userInfo && this.userInfo.system_id) {
this.$trace.setOptionValue("userId", this.userInfo.system_id); this.$trace.setOptionValue("userId", this.userInfo.system_id);
// this.$trace.setOptionValue('userType',this.userInfo.userType) // this.$trace.setOptionValue('userType',this.userInfo.userType)
......
...@@ -2,20 +2,22 @@ ...@@ -2,20 +2,22 @@
<div class="login-by-account"> <div class="login-by-account">
<el-form ref="loginFormRef" label-position="top" :model="loginForm" :rules="steploginFormRules"> <el-form ref="loginFormRef" label-position="top" :model="loginForm" :rules="steploginFormRules">
<el-form-item prop="userid"> <el-form-item prop="userid">
<el-input v-model="loginForm.userid" placeholder="请输入账号" @keyup.enter.native="loginAction()" /> <el-input v-model="loginForm.userid" placeholder="请输入账号" @keyup.enter="loginAction()" />
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input
:type="hidePassword ? 'password' : 'text'" :type="hidePassword ? 'password' : 'text'"
v-model="loginForm.password" v-model="loginForm.password"
placeholder="请输入密码" placeholder="请输入密码"
@keyup.enter.native="loginAction()"> @keyup.enter="loginAction()">
<span <template #suffix>
slot="suffix" <span :title="!hidePassword ? '隐藏密码' : '显示密码'">
:title="hidePassword ? '显示密码' : '隐藏密码'" <bg-icon
:class="hidePassword ? 'hide-password' : 'show-password'" @click="hidePassword = !hidePassword"
@click="hidePassword = !hidePassword" style="font-size: 16px; color: #a9b1c7; cursor: pointer"
style="cursor: pointer"></span> :icon="hidePassword ? '#bg-ic-eye' : '#bg-ic-eye-close'"></bg-icon>
</span>
</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="yzm"> <el-form-item prop="yzm">
...@@ -23,7 +25,7 @@ ...@@ -23,7 +25,7 @@
<el-input <el-input
v-model="loginForm.yzm" v-model="loginForm.yzm"
placeholder="请输入验证码" placeholder="请输入验证码"
@keyup.enter.native="loginAction()" @keyup.enter="loginAction()"
style="width: 240px" /> style="width: 240px" />
<div class="yzm_img"> <div class="yzm_img">
<img title="看不清?换一张" :src="imgSrc" @click="getImg()" style="width: 100%" /> <img title="看不清?换一张" :src="imgSrc" @click="getImg()" style="width: 100%" />
...@@ -57,6 +59,9 @@ import { ElMessage } from "element-plus"; ...@@ -57,6 +59,9 @@ import { ElMessage } from "element-plus";
import axios from "@/request/http.js"; import axios from "@/request/http.js";
import { Encrypt } from "@/services/secret.js"; import { Encrypt } from "@/services/secret.js";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useRouter } from "vue-router";
const router = useRouter();
const state = reactive({ const state = reactive({
loginForm: { loginForm: {
...@@ -125,7 +130,7 @@ const getMenu = (search) => { ...@@ -125,7 +130,7 @@ 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 = () => { const getUser = () => {
Promise.all([getUserInfo(), getMenu("dadb2d3f-e263-48d1-9389-42acb9ea49f8")]).then((res) => { Promise.all([getUserInfo(), getMenu("79a8f214-db78-4db7-9c28-db66276b4be2")]).then((res) => {
if (res[0].data.code == 200 && res[1].data.code == 200) { if (res[0].data.code == 200 && res[1].data.code == 200) {
let data = (res[1].data.data && res[1].data.data[0].children) || []; let data = (res[1].data.data && res[1].data.data[0].children) || [];
store.commit("setUserInfo", res[0].data.data); store.commit("setUserInfo", res[0].data.data);
...@@ -143,9 +148,7 @@ const getUser = () => { ...@@ -143,9 +148,7 @@ const getUser = () => {
store.commit("setMenuObj", menuObj); store.commit("setMenuObj", menuObj);
// } // }
generateRoutes(); generateRoutes();
// this.$router.push("/"); router.push("/");
//跳转到工作台页面
window.location.href = "/apaas/portal/ui/#/";
} }
}); });
}; };
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
v-model="loginForm.mobile" v-model="loginForm.mobile"
autofocus="autofocus" autofocus="autofocus"
placeholder="请输入手机号码" placeholder="请输入手机号码"
@keyup.enter.native="loginAction()" /> @keyup.enter="loginAction()" />
</el-form-item> </el-form-item>
<el-form-item prop="code"> <el-form-item prop="code">
<div class="msg-code"> <div class="msg-code">
<el-input <el-input
v-model="loginForm.code" v-model="loginForm.code"
placeholder="请输入验证码" placeholder="请输入验证码"
@keyup.enter.native="loginAction()" @keyup.enter="loginAction()"
style="width: 280px"> style="width: 280px">
</el-input> </el-input>
<div class="yzm_img"> <div class="yzm_img">
...@@ -34,9 +34,7 @@ ...@@ -34,9 +34,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click.prevent="loginAction()" style="width: 100%"> <el-button type="primary" @click.prevent="loginAction()" style="width: 100%"> 登 录 </el-button>
登 录
</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="register_btn" @click.prevent="$emit('register')" style="width: 100%"> <el-button class="register_btn" @click.prevent="$emit('register')" style="width: 100%">
...@@ -58,6 +56,9 @@ import { generateRoutes } from "../router/index"; ...@@ -58,6 +56,9 @@ import { generateRoutes } from "../router/index";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import axios from "@/request/http.js"; import axios from "@/request/http.js";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useRouter } from "vue-router";
const router = useRouter();
const validatePhone = (rule, value, callback) => { const validatePhone = (rule, value, callback) => {
const reg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/; const reg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
...@@ -93,15 +94,13 @@ const loginFormRef = ref(null); ...@@ -93,15 +94,13 @@ const loginFormRef = ref(null);
const getMsgCode = () => { const getMsgCode = () => {
loginFormRef.value.validateField("mobile", (valid) => { loginFormRef.value.validateField("mobile", (valid) => {
if (valid) { if (valid) {
axios axios.post("/apaas/system/v5/sms/verifyCode", { phone: state.loginForm.mobile }).then(({ data }) => {
.post("/apaas/system/v5/sms/verifyCode", { phone: state.loginForm.mobile }) if (data.code == 200) {
.then(({ data }) => { countDownAction();
if (data.code == 200) { } else {
countDownAction(); ElMessage.error(data.data);
} else { }
ElMessage.error(data.data); });
}
});
} }
}); });
}; // 获取验证码 }; // 获取验证码
...@@ -149,7 +148,7 @@ const getMenu = (search) => { ...@@ -149,7 +148,7 @@ 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 = () => { const getUser = () => {
Promise.all([getUserInfo(), getMenu("dadb2d3f-e263-48d1-9389-42acb9ea49f8")]).then((res) => { Promise.all([getUserInfo(), getMenu("79a8f214-db78-4db7-9c28-db66276b4be2")]).then((res) => {
if (res[0].data.code == 200 && res[1].data.code == 200) { if (res[0].data.code == 200 && res[1].data.code == 200) {
let data = (res[1].data.data && res[1].data.data[0].children) || []; let data = (res[1].data.data && res[1].data.data[0].children) || [];
store.commit("setUserInfo", res[0].data.data); store.commit("setUserInfo", res[0].data.data);
...@@ -167,9 +166,7 @@ const getUser = () => { ...@@ -167,9 +166,7 @@ const getUser = () => {
store.commit("setMenuObj", menuObj); store.commit("setMenuObj", menuObj);
// } // }
generateRoutes(); generateRoutes();
// this.$router.push("/"); router.push("/");
//跳转到工作台页面
window.location.href = "/apaas/portal/ui/#/";
} }
}); });
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment