Browse Source

首页和角色接口联调

wangrulan 2 years ago
parent
commit
28dd517e46

+ 19 - 19
src/common/js/home.js

@@ -2,7 +2,7 @@ import request from '../../utils/request'
 //获取权限信息
 export function getVerification(data) {
   return request({
-    url: '/api/verification',
+    url: '/api/api/verification',
     method: 'post',
     data: data
   })
@@ -10,7 +10,7 @@ export function getVerification(data) {
 // 系统列表
 export function getSystemList(data) {
   return request({
-    url: '/api/web/system/list',
+    url: '/api/api/web/system/list',
     method: 'post',
     data: data
   })
@@ -18,7 +18,7 @@ export function getSystemList(data) {
 // 角色列表
 export function getRoleList(data) {
   return request({
-    url: '/api/web/role/list',
+    url: '/api/api/web/role/list',
     method: 'post',
     data: data
   })
@@ -26,7 +26,7 @@ export function getRoleList(data) {
 // 模板列表
 export function getFunctionList(data) {
   return request({
-    url: '/api/web/function/list',
+    url: '/api/api/web/function/list',
     method: 'post',
     data: data
   })
@@ -34,7 +34,7 @@ export function getFunctionList(data) {
 // 模板添加
 export function getFunctionAdd(data) {
   return request({
-    url: '/api/web/function/add',
+    url: '/api/api/web/function/add',
     method: 'post',
     data: data
   })
@@ -42,7 +42,7 @@ export function getFunctionAdd(data) {
 // 模板修改
 export function getFunctionUpdate(data) {
   return request({
-    url: '/api/web/function/update',
+    url: '/api/api/web/function/update',
     method: 'post',
     data: data
   })
@@ -50,7 +50,7 @@ export function getFunctionUpdate(data) {
 // 模板删除
 export function getFunctionDel(data) {
   return request({
-    url: '/api/web/function/del',
+    url: '/api/api/web/function/del',
     method: 'post',
     data: data
   })
@@ -60,7 +60,7 @@ export function getFunctionDel(data) {
 // 查询top用户信息接口
 export function getTopUserByLoginName(data) {
   return request({
-    url: '/api/web/user/getTopUserByLoginName',
+    url: '/api/api/web/user/getTopUserByLoginName',
     method: 'post',
     data: data
   })
@@ -68,7 +68,7 @@ export function getTopUserByLoginName(data) {
 // 查询所有权限列表接口
 export function getroleAll(data) {
   return request({
-    url: '/api/web/role/all',
+    url: '/api/api/web/role/all',
     method: 'post',
     data: data
   })
@@ -76,7 +76,7 @@ export function getroleAll(data) {
 // 查询地市和区县树形接口(用户列表地区选择框)
 export function getCityAreaList(data) {
   return request({
-    url: '/api/web/area/cityArea',
+    url: '/api/api/web/area/cityArea',
     method: 'post',
     data: data
   })
@@ -84,7 +84,7 @@ export function getCityAreaList(data) {
 // 查询用户权限接口
 export function getRoleByLoginName(data) {
   return request({
-    url: '/api/web/user/getRoleByLoginName',
+    url: '/api/api/web/user/getRoleByLoginName',
     method: 'post',
     data: data
   })
@@ -92,7 +92,7 @@ export function getRoleByLoginName(data) {
 // 查询用户列表接口
 export function getUserList(data) {
   return request({
-    url: '/api/web/user/list',
+    url: '/api/api/web/user/list',
     method: 'post',
     data: data
   })
@@ -100,7 +100,7 @@ export function getUserList(data) {
 // 添加用户接口
 export function getUserAdd(data) {
   return request({
-    url: '/api/web/user/add',
+    url: '/api/api/web/user/add',
     method: 'post',
     data: data
   })
@@ -108,7 +108,7 @@ export function getUserAdd(data) {
 // 修改用户接口
 export function getUserUpdate(data) {
   return request({
-    url: '/api/web/user/update',
+    url: '/api/api/web/user/update',
     method: 'post',
     data: data
   })
@@ -116,7 +116,7 @@ export function getUserUpdate(data) {
 // 删除用户接口
 export function getUserDel(data) {
   return request({
-    url: '/api/web/user/del',
+    url: '/api/api/web/user/del',
     method: 'post',
     data: data
   })
@@ -124,7 +124,7 @@ export function getUserDel(data) {
 // 查询用户详情接口
 export function getUserDetail(data) {
   return request({
-    url: '/api/web/user/detail',
+    url: '/api/api/web/user/detail',
     method: 'post',
     data: data
   })
@@ -132,7 +132,7 @@ export function getUserDetail(data) {
 // 批量复制权限接口
 export function getRoleCopy(data) {
   return request({
-    url: '/api/web/role/copy',
+    url: '/api/api/web/role/copy',
     method: 'post',
     data: data
   })
@@ -143,7 +143,7 @@ export function getRoleCopy(data) {
 // 操作日志
 export function getOperationLogList(data) {
   return request({
-    url: '/api/web/log/operationLog',
+    url: '/api/api/web/log/operationLog',
     method: 'post',
     data: data
   })
@@ -151,7 +151,7 @@ export function getOperationLogList(data) {
 // 登录日志
 export function getVerificationLogList(data) {
   return request({
-    url: '/api/web/log/verificationLog',
+    url: '/api/api/web/log/verificationLog',
     method: 'post',
     data: data
   })

+ 59 - 85
src/components/home/index.vue

@@ -3,23 +3,27 @@
     <div class="user">
       <div class="content">
         <div class="userImg">
-            <i class="el-icon-s-custom"></i>
+          <i class="el-icon-s-custom"></i>
         </div>
         <span class="name">{{ userInfo.userName }}</span>
       </div>
     </div>
-    <div class="title">
-        投 诉 管 理 系 统
-    </div>
+    <div class="title">投 诉 管 理 系 统</div>
     <div class="list">
-        <el-row>
-            <el-col :span="6" v-for="(item, index) in userInfo.list" :key="index" class="content pointer">
-                <div class="img" @click="jump(item)">
-                    <i class="el-icon-s-tools"></i>
-                </div>
-                <span class="name" @click="jump(item)">{{item.name}}</span>
-            </el-col>
-        </el-row>
+      <el-row>
+        <el-col
+          :span="6"
+          v-for="(item, index) in userInfo.list"
+          :key="index"
+          class="content pointer"
+        >
+          <div class="img" @click="jump(item)">
+            <!-- <i class="el-icon-s-tools"></i> -->
+            <img :src="item.webIcon" alt="" style="width:30px;height:30px">
+          </div>
+          <span class="name" @click="jump(item)">{{ item.name }}</span>
+        </el-col>
+      </el-row>
     </div>
   </div>
 </template>
@@ -31,46 +35,7 @@ export default {
   components: {},
   data() {
     return {
-      userInfo: {
-        userName: "河北测试用户",
-        list: [
-          {
-            id: 1,
-            name: "权限管理",
-            url: "url",
-            webIcon: "webIcon",
-            priority: 0,
-          },
-          {
-            id: 1,
-            name: "权限管理",
-            url: "url",
-            webIcon: "webIcon",
-            priority: 0,
-          },
-          {
-            id: 1,
-            name: "权限管理",
-            url: "url",
-            webIcon: "webIcon",
-            priority: 0,
-          },
-          {
-            id: 1,
-            name: "权限管理",
-            url: "url",
-            webIcon: "webIcon",
-            priority: 0,
-          },
-          {
-            id: 1,
-            name: "权限管理",
-            url: "url",
-            webIcon: "webIcon",
-            priority: 0,
-          },
-        ],
-      },
+      userInfo: {},
     };
   },
   computed: {},
@@ -80,20 +45,28 @@ export default {
   },
   methods: {
     init() {
-      // getVerification().then(res=>{
-      //     console.log('res: ', res);
-      // })
+      let params = {
+        token: sessionStorage.getItem('Authorization-Token'),
+        system: "web",
+        fromSystem: sessionStorage.getItem('Authorization-fromSystem'),
+      };
+      getVerification(params).then((res) => {
+        this.userInfo = res.data
+        sessionStorage.setItem('userNameData', this.userInfo.userName)
+      });
     },
-    jump(val){
+    jump(val) {
+      console.log('val----: ', val);
       let routeUrl = this.$router.resolve({
-            path:'/permissions/role',
-            query: {
-                token: sessionStorage.getItem('Authorization-Token'),
-                fromSystem: sessionStorage.getItem('Authorization-fromSystem'),
-            }
-        })
-        window.open(routeUrl.href, '_blank');
-    }
+        // path: "/permissions/role",
+        path:val.url,
+        // query: {
+        //   token: sessionStorage.getItem("Authorization-Token"),
+        //   fromSystem: sessionStorage.getItem("Authorization-fromSystem"),
+        // },
+      });
+      window.open(routeUrl.href, "_blank");
+    },
   },
 };
 </script>
@@ -119,29 +92,30 @@ export default {
   }
 }
 .title {
-    width: 100%;
-    height: 50px;
-    text-align: center;
-    font-size: 30px;
-    line-height: 50px;
-    margin-top: 30px;
-    margin-bottom: 20px;
+  width: 100%;
+  height: 50px;
+  text-align: center;
+  font-size: 30px;
+  line-height: 50px;
+  margin-top: 30px;
+  margin-bottom: 20px;
 }
-.list{
-    width: 1000px;
-    margin: 0 auto;
-    .content{
-        height: 80px;
-        line-height: 80px;
-        .img{
-            font-size: 30px;
-            float: left;
-        }
-        .name{
-            float: left;
-            margin-left: 10px;
-        }
+.list {
+  width: 1000px;
+  margin: 0 auto;
+  .content {
+    height: 80px;
+    line-height: 80px;
+    .img {
+      font-size: 30px;
+      float: left;
+      line-height: 80px;
+    }
+    .name {
+      float: left;
+      margin-left: 10px;
     }
+  }
 }
 </style>
   

+ 3 - 2
src/components/permissions/index.vue

@@ -60,7 +60,7 @@ export default {
     return {
       isfold: false,
       isCollapse:false,
-      userName:'河北测试用户',
+      userName:'',
       navList: [
         {
           name: '权限管理',
@@ -102,7 +102,7 @@ export default {
   },
 
   created() {
-    console.log(this.$router)
+    
     this.$router.push({
           path:'/permissions/role',
           query: {
@@ -110,6 +110,7 @@ export default {
               fromSystem: sessionStorage.getItem('Authorization-fromSystem'),
           }
       })
+    this.userName  = sessionStorage.getItem('userNameData')
     this.init();
   },
   methods: {

+ 7 - 9
src/components/permissions/role/index.vue

@@ -89,17 +89,15 @@ export default {
   },
   methods: {
     init() {
-      // getSystemList().then(res=>{
-      //   console.log('res: ', res);
-      //   this.systemList = res.data
-      // })
+      getSystemList().then(res=>{
+        this.systemList = res.data
+      })
     },
     getList() {
-      // getRoleList(this.queryParams).then(res=>{
-      //   console.log('res: ', res);
-      //   this.tableList = res.data;
-      //   this.total = res.total
-      // })
+      getRoleList(this.queryParams).then(res=>{
+        this.tableList = res.data.list;
+        this.total = res.data.total
+      })
     },
     handleQuery() {
       this.getList();