Commit 31fe2001 authored by liwenhong's avatar liwenhong

add

parent 217537d0
...@@ -21,6 +21,7 @@ module.exports = { ...@@ -21,6 +21,7 @@ module.exports = {
API_INTERNAL_URI: API_INTERNAL_URI[env], API_INTERNAL_URI: API_INTERNAL_URI[env],
PANDORA_URI: PANDORA_URI[env], PANDORA_URI: PANDORA_URI[env],
GOODS_URI: API_INTERNAL_URI[env], GOODS_URI: API_INTERNAL_URI[env],
ACTIVITY_URI: API_INTERNAL_URI[env],
GROUPMEAL_URI: API_INTERNAL_URI[env], GROUPMEAL_URI: API_INTERNAL_URI[env],
WITHDRAWAL_URI: API_INTERNAL_URI[env], WITHDRAWAL_URI: API_INTERNAL_URI[env],
API_YD_LOGIN API_YD_LOGIN
......
...@@ -10,29 +10,33 @@ ...@@ -10,29 +10,33 @@
</template> </template>
<script> <script>
// import { fetchCurrentUser } from "./service/user"; import { fetchCurrentUser } from "./service/user";
import { getCookie, redirectToLogin } from "@/utils/util"; import { getCookie, redirectToLogin } from "@/utils/util";
export default { export default {
mounted() { async mounted() {
console.log(getCookie('username')); console.log(getCookie('username'));
if(!getCookie('username')) { if(!getCookie('username')) {
this.$message('请先登录'); this.$message('请先登录');
redirectToLogin(); redirectToLogin();
} }
// if (this.$store.state.permissions && this.$store.state.userInfo) return; if (this.$store.state.permissions && this.$store.state.userInfo) return;
// const { status, user } = await fetchCurrentUser(); let isDefault = window.localStorage.getItem('isDefault');
// if (status === "success") { if(isDefault == 2) {
// this.$store.commit("updateUserInfo", user); user.email = getCookie('username');
// console.log('user',user) }
// this.$store.dispatch("updateUserPermission", { email: user.email }); const { status, user } = await fetchCurrentUser();
// // 无奈之举,后期需要重构到提现管理中 if (status === "success") {
// this.$store.dispatch("fetchPermission", { this.$store.commit("updateUserInfo", user);
// appId: "merchant-op-auditing", console.log('user',user)
// }); this.$store.dispatch("updateUserPermission", { email: user.email });
// } else { // 无奈之举,后期需要重构到提现管理中
// redirectToLogin(); this.$store.dispatch("fetchPermission", {
// } appId: "merchant-op-auditing",
});
} else {
redirectToLogin();
}
}, },
computed: { computed: {
......
...@@ -7,10 +7,11 @@ import ElementPlus from "element-plus"; ...@@ -7,10 +7,11 @@ import ElementPlus from "element-plus";
import "element-plus/lib/theme-chalk/index.css"; import "element-plus/lib/theme-chalk/index.css";
import "dayjs/locale/zh-cn"; import "dayjs/locale/zh-cn";
import locale from "element-plus/lib/locale/lang/zh-cn"; import locale from "element-plus/lib/locale/lang/zh-cn";
import { ElMessage } from "element-plus";
import { fetchCurrentUser } from "./service/user"; // import { fetchCurrentUser } from "./service/user";
import { checkPathAuth } from "./utils/authUtil"; import { checkPathAuth } from "./utils/authUtil";
import { redirectToLogin, getCookie } from "./utils/util"; import { redirectToLogin } from "./utils/util";
// 处理路由权限 // 处理路由权限
router.beforeResolve(async (to, from, next) => { router.beforeResolve(async (to, from, next) => {
...@@ -21,28 +22,31 @@ router.beforeResolve(async (to, from, next) => { ...@@ -21,28 +22,31 @@ router.beforeResolve(async (to, from, next) => {
if(!store.state.permissions && !store.state.userInfo) { if(!store.state.permissions && !store.state.userInfo) {
redirectToLogin(); redirectToLogin();
// location.href = '/' // location.href = '/'
next(); // next();
} // return this.$message("您没有权限");
if (!store.state.permissions) { // return ElMessage.error('您没有权限');
this.$message('您暂无权限');
let isDefault = window.localStorage.getItem('isDefault');
if(isDefault == 2) {
user.email = getCookie('username');
}
const { status, user } = await fetchCurrentUser();
if (status === 'success') {
store.commit('updateUserInfo', user);
await store.dispatch('updateUserPermission', { email: user.email })
} else {
redirectToLogin();
return false;
}
} }
// if (!store.state.permissions) {
// ElMessage.error('您没有权限');
// // this.$message('您暂无权限');
// let isDefault = window.localStorage.getItem('isDefault');
// if(isDefault == 2) {
// user.email = getCookie('username');
// }
// const { status, user } = await fetchCurrentUser();
// if (status === 'success') {
// store.commit('updateUserInfo', user);
// await store.dispatch('updateUserPermission', { email: user.email })
// } else {
// redirectToLogin();
// return false;
// }
// }
if (!checkPathAuth(to.path)) { if (!checkPathAuth(to.path)) {
router.push('/op/login'); redirectToLogin();
return this.$message("您没有权限"); return ElMessage.error('您没有权限');
} else { } else {
next(); next();
} }
......
.tab-show { .tab-show {
width: 100%; width: 100%;
height: 100%; // height: 100%;
padding: 0px 55px; padding: 0px 55px;
background-color: white; background-color: white;
.el-tabs__nav-wrap::after { .el-tabs__nav-wrap::after {
......
...@@ -6,14 +6,14 @@ const headerConfig = [ ...@@ -6,14 +6,14 @@ const headerConfig = [
{ {
path: "/op/withdrawal/roleManageRole", path: "/op/withdrawal/roleManageRole",
name: "角色管理", name: "角色管理",
requireAuthentication: true, // requireAuthentication: true,
requiredPermission: "role_management" // requiredPermission: "role_management"
}, },
{ {
path: "/op/withdrawal/user", path: "/op/withdrawal/user",
name: "用户管理", name: "用户管理",
requireAuthentication: true, // requireAuthentication: true,
requiredPermission: "user_management" // requiredPermission: "user_management"
} }
]; ];
......
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