|
@@ -29,6 +29,9 @@ import {
|
|
|
get_action_data,
|
|
|
set_action_data,
|
|
|
remove_action_data,
|
|
|
+ get_role_level,
|
|
|
+ set_role_level,
|
|
|
+ remove_role_level,
|
|
|
} from "@/utils/auth";
|
|
|
import store from "..";
|
|
|
const state = {
|
|
@@ -39,6 +42,7 @@ const state = {
|
|
|
roles: ["admin"],
|
|
|
btnList: getBtn(),
|
|
|
navList: getMenu(),
|
|
|
+ role_level:get_role_level() || "1",
|
|
|
business_company: get_business_company() || "",
|
|
|
business_companyNo: get_business_companyNo() || "",
|
|
|
private_field: get_private_field() || [],
|
|
@@ -66,13 +70,6 @@ const mutations = {
|
|
|
SET_ROLES: (state, roles) => {
|
|
|
state.roles = roles;
|
|
|
},
|
|
|
- // mainListFn(state, val) {
|
|
|
- // if (!val) {
|
|
|
- // val = [];
|
|
|
- // }
|
|
|
- // state.mainList = val;
|
|
|
- // setMainList(val)
|
|
|
- // },
|
|
|
navListFn(state, val) {
|
|
|
if (!val) {
|
|
|
val = [];
|
|
@@ -157,23 +154,13 @@ const actions = {
|
|
|
} else if (ucode !== 0) {
|
|
|
resolve({ code: ucode, data: udata, massage: umsg });
|
|
|
} else {
|
|
|
- const { business, private_field, roleid } = udata;
|
|
|
- let business_company = "",
|
|
|
- business_companyNo = "";
|
|
|
- if (business && business.length > 0) {
|
|
|
- business.forEach((e) => {
|
|
|
- if (e.is_main === "1") {
|
|
|
- business_company = e.company;
|
|
|
- business_companyNo = e.companyNo;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- // 保存默认业务公司名称
|
|
|
- commit("business_company", business_company);
|
|
|
- // 保存默认业务公司编号
|
|
|
- commit("business_companyNo", business_companyNo);
|
|
|
+
|
|
|
+ // // 保存默认业务公司名称
|
|
|
+ // commit("business_company", business_company);
|
|
|
+ // // 保存默认业务公司编号
|
|
|
+ // commit("business_companyNo", business_companyNo);
|
|
|
// 关键字段设置
|
|
|
- commit("private_field", private_field === "" ? [] : private_field);
|
|
|
+ // commit("private_field", private_field === "" ? [] : private_field);
|
|
|
// const { pcode, pdata, pmsg } = await getRoleProcess(roleid);
|
|
|
// if (pcode >= 100 && pcode <= 104) {
|
|
|
// resolve("noToken");
|
|
@@ -189,14 +176,12 @@ const actions = {
|
|
|
resolve({ code: mcodd, data: {}, massage: mmsg });
|
|
|
} else {
|
|
|
const { arrag, isok, btnList } = mdata;
|
|
|
-
|
|
|
// 生成页面权限
|
|
|
commit("navListFn", arrag);
|
|
|
// 生成按钮权限
|
|
|
commit("btnListFn", btnList);
|
|
|
// 生成路由
|
|
|
initRouter(arrag, that);
|
|
|
- // state.commit("loginInfoCommit", res.data);
|
|
|
resolve(isok ? "success-dataV" : "success");
|
|
|
}
|
|
|
// }
|