|
@@ -55,7 +55,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import { ref, reactive, toRefs } from "vue";
|
|
|
|
|
|
|
+import { ref, reactive, toRefs, computed } from "vue";
|
|
|
import { ElNotification } from "element-plus";
|
|
import { ElNotification } from "element-plus";
|
|
|
import store from "../../store";
|
|
import store from "../../store";
|
|
|
import router from "../../router";
|
|
import router from "../../router";
|
|
@@ -98,12 +98,6 @@ export default {
|
|
|
password,
|
|
password,
|
|
|
});
|
|
});
|
|
|
if (res.data.status == 0) {
|
|
if (res.data.status == 0) {
|
|
|
- ElNotification.success({
|
|
|
|
|
- title: "成功",
|
|
|
|
|
- duration: 2000,
|
|
|
|
|
- message: res.data.msg,
|
|
|
|
|
- type: "success",
|
|
|
|
|
- });
|
|
|
|
|
let {
|
|
let {
|
|
|
userId,
|
|
userId,
|
|
|
userName,
|
|
userName,
|
|
@@ -112,6 +106,21 @@ export default {
|
|
|
loginAccountId,
|
|
loginAccountId,
|
|
|
rolePermission,
|
|
rolePermission,
|
|
|
} = res.data.result;
|
|
} = res.data.result;
|
|
|
|
|
+ if (!rolePermission.length) {
|
|
|
|
|
+ ElNotification.error({
|
|
|
|
|
+ title: "失败",
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ message: "暂无权限,请联系管理员",
|
|
|
|
|
+ type: "error",
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ ElNotification.success({
|
|
|
|
|
+ title: "成功",
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ message: res.data.msg,
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ });
|
|
|
localStorage.setItem("userId", userId);
|
|
localStorage.setItem("userId", userId);
|
|
|
localStorage.setItem("userName", userName);
|
|
localStorage.setItem("userName", userName);
|
|
|
localStorage.setItem("phone", phone);
|
|
localStorage.setItem("phone", phone);
|
|
@@ -119,15 +128,19 @@ export default {
|
|
|
localStorage.setItem("userType", 1);
|
|
localStorage.setItem("userType", 1);
|
|
|
localStorage.setItem("loginAccountId", loginAccountId);
|
|
localStorage.setItem("loginAccountId", loginAccountId);
|
|
|
rolePermission = rolePermission || [];
|
|
rolePermission = rolePermission || [];
|
|
|
- let arr = [...new Set([...rolePermission, "VOYAGELIST"])];
|
|
|
|
|
|
|
+ let arr = [...new Set([...rolePermission])];
|
|
|
localStorage.setItem("rolePermission", arr);
|
|
localStorage.setItem("rolePermission", arr);
|
|
|
- store.commit("changeLogin", true);
|
|
|
|
|
store.dispatch(
|
|
store.dispatch(
|
|
|
"GetBasePermissionData",
|
|
"GetBasePermissionData",
|
|
|
localStorage.loginAccountId
|
|
localStorage.loginAccountId
|
|
|
);
|
|
);
|
|
|
- store.dispatch("GetUserPermission", localStorage.loginAccountId);
|
|
|
|
|
- router.replace({ path: "/voyage/voyageList" });
|
|
|
|
|
|
|
+ let res1 = await store.dispatch(
|
|
|
|
|
+ "GetUserPermission",
|
|
|
|
|
+ localStorage.loginAccountId
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ router.replace({ path: store.state.menuData[0]?.items[0].path });
|
|
|
|
|
+ store.commit("changeLogin", true);
|
|
|
} else {
|
|
} else {
|
|
|
ElNotification.error({
|
|
ElNotification.error({
|
|
|
title: "错误",
|
|
title: "错误",
|