Browse Source

初始化

元子 5 months ago
parent
commit
eefa47881b
4 changed files with 23 additions and 23 deletions
  1. 2 2
      public/config.js
  2. 3 3
      src/api/user.js
  3. 2 2
      src/layout/components/Sidebar/SidebarItem.vue
  4. 16 16
      src/store/modules/user.js

+ 2 - 2
public/config.js

@@ -1,4 +1,4 @@
 window.g = {
-  ApiUrl: "https://noise.hz-hanghui.com:8088/hanghui-warehouse",
-  // ApiUrl: "http://hd3z9z.natappfree.cc/back-management", //本地
+  // ApiUrl: "https://noise.hz-hanghui.com:8088/hanghui-warehouse",
+  ApiUrl: "http://hd3z9z.natappfree.cc/back-management", //本地
 };

+ 3 - 3
src/api/user.js

@@ -2,7 +2,7 @@ import request from "@/utils/request";
 // 后台管理登录/auth
 export function login(params) {
   return request({
-    url: "/admin/auth/doLogin",
+    url: "/admin/doLogin",
     method: "get",
     params,
   });
@@ -10,7 +10,7 @@ export function login(params) {
 // 后台管理退出登录
 export function logout(params) {
   return request({
-    url: "/admin/auth/doLogout",
+    url: "/admin/doLogout",
     method: "get",
     params,
   });
@@ -18,7 +18,7 @@ export function logout(params) {
 // 获取管理员信息
 export function getInfo() {
   return request({
-    url: "/admin/auth/doGetInfo",
+    url: "/admin/doGetInfo",
     method: "get",
   });
 }

+ 2 - 2
src/layout/components/Sidebar/SidebarItem.vue

@@ -1,6 +1,6 @@
 <template>
-  <!-- <div v-if="!item.hidden && hasPower(item)"> -->
-    <div v-if="!item.hidden">
+  <div v-if="!item.hidden && hasPower(item)">
+    <!-- <div v-if="!item.hidden"> -->
     <template
       v-if="
         hasOneShowingChild(item.children, item) &&

+ 16 - 16
src/store/modules/user.js

@@ -149,22 +149,22 @@ const actions = {
           commit("SET_USERNAME", data.username);
           commit("SET_ROLE", data.type);
           //
-          // commit("SET_PROVINCECODE", data.adminAuthDto.provinceCode);
-          // commit("SET_GATEAUTH", data.adminAuthDto.gateAuth);
-          // commit("SET_PORTAUTH", data.adminAuthDto.portAuth);
-          // commit("SET_CAPTUREAUTH", data.adminAuthDto.captureAuth);
-          // commit("SET_VEHICLEAUTH", data.adminAuthDto.vehicleAuth);
-          // commit("SET_ARCHIVESAUTH", data.adminAuthDto.archivesAuth);
-          // commit(
-          //   "SET_BEHAVIORARCHIVESAUTH",
-          //   data.adminAuthDto.behaviorArchivesAuth
-          // );
-          // commit("SET_WARNINGAUTH", data.adminAuthDto.warningAuth);
-          // commit("SET_FUNCTIONAUTH", data.adminAuthDto.functionAuth);
-          // commit("SET_UAVAUTH", data.adminAuthDto.uavAuth);
-          // commit("SET_TRAFFICLIGTSAUTH", data.adminAuthDto.trafficLightsAuth);
-          // commit("SET_RAINSNOWAUTH", data.adminAuthDto.rainSnowAuth);
-          // commit("SET_COCKPITAUTH", data.adminAuthDto.cockpitAuth);
+          commit("SET_PROVINCECODE", data.adminAuthDto.provinceCode);
+          commit("SET_GATEAUTH", data.adminAuthDto.gateAuth);
+          commit("SET_PORTAUTH", data.adminAuthDto.portAuth);
+          commit("SET_CAPTUREAUTH", data.adminAuthDto.captureAuth);
+          commit("SET_VEHICLEAUTH", data.adminAuthDto.vehicleAuth);
+          commit("SET_ARCHIVESAUTH", data.adminAuthDto.archivesAuth);
+          commit(
+            "SET_BEHAVIORARCHIVESAUTH",
+            data.adminAuthDto.behaviorArchivesAuth
+          );
+          commit("SET_WARNINGAUTH", data.adminAuthDto.warningAuth);
+          commit("SET_FUNCTIONAUTH", data.adminAuthDto.functionAuth);
+          commit("SET_UAVAUTH", data.adminAuthDto.uavAuth);
+          commit("SET_TRAFFICLIGTSAUTH", data.adminAuthDto.trafficLightsAuth);
+          commit("SET_RAINSNOWAUTH", data.adminAuthDto.rainSnowAuth);
+          commit("SET_COCKPITAUTH", data.adminAuthDto.cockpitAuth);
           resolve(data);
         })
         .catch((error) => {