Browse Source

首页登录多次错误验证、项目查询权限验证

user5 2 years ago
parent
commit
b044f9099e

+ 9 - 4
src/views/modules/sys/login/login.vue

@@ -97,8 +97,8 @@
         isShow: false,
         checked: false,
         inputForm: {
-          username: 'admin',
-          password: 'admin',
+          username: '',
+          password: '',
           uuid: '',
           code: ''
         },
@@ -129,10 +129,14 @@
       }, 1000)
     },
     mounted () {
+      this.getCookie()
       this.configService.getConfig().then(({data}) => {
         this.productName = data.productName
       })
-      this.getCaptcha()
+      // this.getCaptcha()
+      if (this.inputForm.username) {
+        this.getLoginCodeNumber(this.inputForm.username)
+      }
     },
     methods: {
       // 提交表单
@@ -171,7 +175,7 @@
               })
             }).catch(e => {
               this.loading = false
-              this.getCaptcha()
+              this.getLoginCodeNumber(this.inputForm.username)
             })
           }
         })
@@ -189,6 +193,7 @@
       // 获取验证码
       getLoginCodeNumber (username) {
         this.loginService.getLoginCodeNumber(username).then(({data}) => {
+          console.log(11111)
           if (data.redisLoginNumber >= data.loginNumber) {
             this.getCaptcha()
             this.isShow = true

+ 21 - 4
src/views/modules/sys/project/AssessList.vue

@@ -14,6 +14,20 @@
         <el-form-item prop="customerName">
           <el-input size="small" v-model="searchForm.customerName" placeholder="客户名称" clearable></el-input>
         </el-form-item>
+        <el-form-item prop="projectHead" :rules=" [{trigger: 'blur'}]" label="项目负责人">
+          <SelectUserTree
+            ref="companyTree"
+            :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+            :url="`/sys/user/treeUserDataAllOffice?type=2`"
+            :value="searchForm.projectHead"
+            :clearable="true"
+            :accordion="true"
+            @getValue="(value) => {searchForm.projectHead=value}"/>
+        </el-form-item>
           <el-form-item>
             <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
             <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
@@ -110,8 +124,8 @@
                 <vxe-column title="操作" width="200px" fixed="right" align="center">
                     <template  slot-scope="scope">
                       <el-button v-if="hasPermission('sys:project:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
-                      <el-button v-if="hasPermission('sys:project:edit')" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
-                      <el-button v-if="hasPermission('sys:project:del')" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+                      <el-button v-if="hasPermission('sys:project:edit') && scope.row.permissionFlag" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
+                      <el-button v-if="hasPermission('sys:project:del') && scope.row.permissionFlag" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
                     </template>
                 </vxe-column>
             </vxe-table>
@@ -134,13 +148,15 @@
 
 <script>
   import AssessForm from './AssessForm'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   import ProjectService from '@/api/sys/ProjectService'
   export default {
     data () {
       return {
         searchForm: {
           customerName: '',
-          projectName: ''
+          projectName: '',
+          projectHead: ''
         },
         dataList: [],
         tablePage: {
@@ -157,7 +173,8 @@
       this.projectService = new ProjectService()
     },
     components: {
-      AssessForm
+      AssessForm,
+      SelectUserTree
     },
     activated () {
       this.refreshList()

+ 21 - 4
src/views/modules/sys/project/ConsultationList.vue

@@ -15,6 +15,20 @@
         <el-form-item prop="customerName">
           <el-input size="small" v-model="searchForm.customerName" placeholder="客户名称" clearable></el-input>
         </el-form-item>
+        <el-form-item prop="projectHead" :rules=" [{trigger: 'blur'}]" label="项目负责人">
+          <SelectUserTree
+            ref="companyTree"
+            :props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+            :url="`/sys/user/treeUserDataAllOffice?type=2`"
+            :value="searchForm.projectHead"
+            :clearable="true"
+            :accordion="true"
+            @getValue="(value) => {searchForm.projectHead=value}"/>
+        </el-form-item>
           <el-form-item>
             <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
             <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
@@ -112,8 +126,8 @@
                 <vxe-column title="操作" width="200px" fixed="right" align="center">
                     <template  slot-scope="scope">
                       <el-button v-if="hasPermission('sys:project:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
-                      <el-button v-if="hasPermission('sys:project:edit')" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
-                      <el-button v-if="hasPermission('sys:project:del')" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+                      <el-button v-if="hasPermission('sys:project:edit') && scope.row.permissionFlag" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
+                      <el-button v-if="hasPermission('sys:project:del') && scope.row.permissionFlag" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
                     </template>
                 </vxe-column>
             </vxe-table>
@@ -136,13 +150,15 @@
 
 <script>
   import ConsultationForm from './ConsultationForm'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   import ProjectService from '@/api/sys/ProjectService'
   export default {
     data () {
       return {
         searchForm: {
           customerName: '',
-          projectName: ''
+          projectName: '',
+          projectHead: ''
         },
         dataList: [],
         tablePage: {
@@ -159,7 +175,8 @@
       this.projectService = new ProjectService()
     },
     components: {
-      ConsultationForm
+      ConsultationForm,
+      SelectUserTree
     },
     activated () {
       this.refreshList()