进入后台管理

zhangtao
laozt 1 year ago
parent 5b616a9363
commit 1f69106ba5

@ -8,7 +8,7 @@
<script> <script>
import ThemePicker from "@/components/ThemePicker"; import ThemePicker from "@/components/ThemePicker";
import { xzTree } from "@/api/yingji/keyEnterprise.js"; import { xzTree } from "@/api/yingji/keyEnterprise.js";
import { mapState } from "vuex"; // import { mapState } from "vuex";
export default { export default {
name: "App", name: "App",
@ -35,26 +35,24 @@ export default {
}); });
}, },
computed: { computed: {
...mapState({ // ...mapState({
isorgpwd: (state) => state.user.isorgpwd, // isorgpwd: (state) => state.user.isorgpwd,
}), // }),
}, },
watch: { watch: {
isorgpwd(newVal, oldVal) { // isorgpwd(newVal, oldVal) {
// console.log(""); // //
// console.log(newVal, oldVal); // let _this = this
// // if (newVal) {
let _this = this // this.$alert("", "", {
if (newVal) { // confirmButtonText: "",
this.$alert("您的密码为原始密码,需要修改!", "警告信息", { // showClose: false,
confirmButtonText: "确定", // callback: (action) => {
showClose: false, // _this.$router.push("/user/profile");
callback: (action) => { // },
_this.$router.push("/user/profile"); // });
}, // }
}); // },
}
},
}, },
}; };
</script> </script>

@ -56,19 +56,15 @@
</div> </div>
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<router-link v-show="userInfo.userName == 'admin'" to="/system/user">
<el-dropdown-item>进入后台管理</el-dropdown-item>
</router-link>
<router-link to="/user/profile"> <router-link to="/user/profile">
<el-dropdown-item>修改密码</el-dropdown-item> <el-dropdown-item>修改密码</el-dropdown-item>
</router-link> </router-link>
<el-dropdown-item @click.native="logout">退出登录</el-dropdown-item> <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<!-- <div
class="showGLstyle"
v-if="roles && roles[0] == 'admin'"
@click="toNewPage"
>
进入管理平台
</div> -->
</header> </header>
<div class="bottom-view"> <div class="bottom-view">
<router-view></router-view> <router-view></router-view>
@ -86,6 +82,7 @@ export default {
routerIndex: 0, routerIndex: 0,
avatarFlag: false, avatarFlag: false,
userName: null, userName: null,
userInfo: JSON.parse(sessionStorage.getItem("USER_INFO")),
}; };
}, },
computed: { computed: {
@ -102,11 +99,12 @@ export default {
"isGovernmentAffairsNetwork" "isGovernmentAffairsNetwork"
); );
// const G_USER_INFO = JSON.parse(localStorage.getItem("G_USER_INFO")); // const G_USER_INFO = JSON.parse(localStorage.getItem("G_USER_INFO"));
let userInfo = JSON.parse(sessionStorage.getItem("USER_INFO")); // let userInfo = JSON.parse(sessionStorage.getItem("USER_INFO"));
if (isGovernmentAffairsNetwork == "1") { // if (isGovernmentAffairsNetwork == "1") {
this.userName = userInfo.lawLevel + " " + userInfo.nickName; if (this.userInfo.userName == "admin") {
this.userName = this.userInfo.userName;
} else { } else {
this.userName = userInfo.lawLevel + " " + userInfo.nickName; this.userName = this.userInfo.lawLevel + " " + this.userInfo.nickName;
} }
}, },
watch: { watch: {
@ -139,6 +137,8 @@ export default {
let isGovernmentAffairsNetwork = localStorage.getItem( let isGovernmentAffairsNetwork = localStorage.getItem(
"isGovernmentAffairsNetwork" "isGovernmentAffairsNetwork"
); );
sessionStorage.removeItem("SET_IS_ORG_PWD");
// console.log(""); // console.log("");
if (isGovernmentAffairsNetwork == "1") { if (isGovernmentAffairsNetwork == "1") {
localStorage.removeItem("isGovernmentAffairsNetwork"); localStorage.removeItem("isGovernmentAffairsNetwork");

@ -70,7 +70,8 @@ const user = {
commit("SET_TOKEN", res.token); commit("SET_TOKEN", res.token);
// 判断是否是初始密码 // 判断是否是初始密码
if (password == "Yingji@123") { if (password == "Yingji@123") {
commit("SET_IS_ORG_PWD", true); // commit("SET_IS_ORG_PWD", true);
sessionStorage.setItem("SET_IS_ORG_PWD", JSON.stringify(true));
} }
resolve(); resolve();
}) })
@ -119,7 +120,7 @@ const user = {
getInfo() getInfo()
.then((res) => { .then((res) => {
const user = res.user; const user = res.user;
sessionStorage.setItem("USER_INFO", JSON.stringify(user)) sessionStorage.setItem("USER_INFO", JSON.stringify(user));
commit("get_dept", user.dept); commit("get_dept", user.dept);
const avatar = const avatar =
user.avatar == "" || user.avatar == null user.avatar == "" || user.avatar == null

@ -20,36 +20,38 @@
<div class="content"> <div class="content">
<!-- tabs --> <!-- tabs -->
<div class="module"> <div class="module">
<div <!-- <div
class="select" class="select"
:class="{ nextStepSelect: activeTab == 0 }" :class="{ nextStepSelect: activeTab == 0 }"
@click="selectTab(0)" @click="selectTab(0)"
> >
<span class="span-one"></span> <span class="span-one"></span>
<span>选择省重点</span> <span>选择省重点</span>
</div> </div> -->
<div <div
class="issue" class="issue"
:class="{ nextStepIssue: activeTab == 1 }" :class="{ nextStepIssue: activeTab == 1 }"
@click="selectTab(1)" @click="selectTab(1)"
> >
<span class="span-one"></span> <!-- <span class="span-one"></span> -->
<span>选择非省重点</span> <span class="span-one"></span>
<span>选择企业</span>
</div> </div>
<div <div
class="issue" class="issue"
:class="{ nextStepIssue: activeTab == 2 }" :class="{ nextStepIssue: activeTab == 2 }"
@click="selectTab(2)" @click="selectTab(2)"
> >
<span class="span-one"></span> <!-- <span class="span-one"></span> -->
<span class="span-one"></span>
<span>草稿箱</span> <span>草稿箱</span>
</div> </div>
</div> </div>
<!-- tabs-content --> <!-- tabs-content -->
<div v-show="activeTab == 0"> <!-- <div v-show="activeTab == 0">
<tab1 ref="tabs1" @nextTab="selectTab" /> <tab1 ref="tabs1" @nextTab="selectTab" />
</div> </div> -->
<div v-show="activeTab == 1"> <div v-show="activeTab == 1">
<tab2 ref="tabs2" @nextTab="selectTab" /> <tab2 ref="tabs2" @nextTab="selectTab" />
</div> </div>
@ -63,7 +65,7 @@
</template> </template>
<script> <script>
//tab //tab
import tab1 from "./tab1.vue"; // import tab1 from "./tab1.vue";
import tab2 from "./tab2.vue"; import tab2 from "./tab2.vue";
import tab3 from "./tab3.vue"; import tab3 from "./tab3.vue";
@ -75,10 +77,11 @@ export default {
"entpr_color", "entpr_color",
"major_hazard_level", "major_hazard_level",
], ],
components: { tab1, tab2, tab3 }, // components: { tab1, tab2, tab3 },
components: { tab2, tab3 },
data() { data() {
return { return {
activeTab: 0, activeTab: 1,
dialogVisible: false, dialogVisible: false,
}; };
}, },
@ -97,7 +100,7 @@ export default {
}, },
// //
openDialog() { openDialog() {
this.activeTab = 0; this.activeTab = 1;
this.dialogVisible = true; this.dialogVisible = true;
}, },
// //

Loading…
Cancel
Save