判断是否登录。

feature_0521
kevin jiang 5 years ago
parent abf4f2ce10
commit 4798e009ba

@ -13,6 +13,8 @@
</template> </template>
<script> <script>
import {checkLogin} from "../../utils/Common";
export default { export default {
name: "OrganizationMain", name: "OrganizationMain",
data() { data() {
@ -22,6 +24,7 @@
} }
}, },
created() { created() {
checkLogin();
this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel")); this.threeLevel = JSON.parse(sessionStorage.getItem("threeLevel"));
this.menuInit(); this.menuInit();
}, },

@ -51,6 +51,7 @@
import zeroExtend from "../../services/customer/zeroExtend"; import zeroExtend from "../../services/customer/zeroExtend";
import staff from "../../services/staff/staff"; import staff from "../../services/staff/staff";
import IncreaseData from "../../services/generalize/IncreaseData"; import IncreaseData from "../../services/generalize/IncreaseData";
import {checkLogin} from "../../utils/Common";
export default { export default {
data() { data() {
@ -200,6 +201,9 @@
shopList: [], // shopList: [], //
} }
}, },
created() {
checkLogin();
},
mounted: function () { mounted: function () {
this.getSelectList(); this.getSelectList();
this.listRoleInfo(); this.listRoleInfo();

@ -18,6 +18,13 @@ export function goToLogin() {
roter.push("/login"); roter.push("/login");
} }
export function checkLogin() {
// store.commit("LOGOUT");
if(!sessionStorage.getItem("loginInfo")){
goToLogin();
}
}
export function formatDate(dt) { export function formatDate(dt) {
dt = new Date(dt); dt = new Date(dt);
let year = dt.getFullYear(); let year = dt.getFullYear();

Loading…
Cancel
Save