Shannon_mu 3 gadi atpakaļ
vecāks
revīzija
575e95c04c

+ 11 - 3
userCenter/src/components/common/Header.vue

@@ -15,7 +15,13 @@
                 <!-- 用户头像 -->
                 <div class="user-avator" @click="editUserInfo">
                     <i class="iconfont" v-show="!cruUserInfo.photo" v-bottom-txt-tip data-txt="编辑用户信息">&#xe6e8;</i>
-                    <img v-show="cruUserInfo.photo" :src="envConfig.baseImgApi + cruUserInfo.photo" />
+                    
+                    <div
+                        class="imgs"
+                        v-show="cruUserInfo.photo"
+                        :style="'backgroundImage:' + 'url(' + envConfig.baseImgApi + cruUserInfo.photo + ');'"
+                    ></div>
+                    <!-- <img v-show="cruUserInfo.photo" :src="envConfig.baseImgApi + cruUserInfo.photo" /> -->
                 </div>
                 <!-- <span style="width: 1px; height: 16px; background: #FFFFFF; opacity: 0.5"></span> -->
                 <div class="message">
@@ -355,9 +361,11 @@ export default {
 .user-avator {
     margin-left: 10px;
     margin-right: 20px;
+    cursor: pointer;
 }
-.user-avator img {
-    display: block;
+.user-avator .imgs {
+    background: no-repeat center top;
+    background-size: cover;
     width: 20px;
     height: 20px;
 }

+ 1 - 1
userCenter/src/config/env.development.js

@@ -20,7 +20,7 @@ module.exports = {
   // eventHiddenDangerUrl:"http://114.135.61.188:18093/maintenance/eventHiddenDanger",// 运维管理系统-工单管理-事件隐患界面
 
 
-  baseUrl: "http://114.135.61.188:18093/sc-login/", // 项目地址
+  baseUrl: "http://114.135.61.188:18093/sc-system/", // 项目地址
   baseApi: "http://192.168.0.121:8082", // 本地api请求地址
   baseMapApi: "http://114.135.61.187:38082", // arcgis API
   baseImgApi: "http://114.135.61.186:21020", // 图片api请求地址

+ 1 - 1
userCenter/src/config/env.production.js

@@ -8,7 +8,7 @@
 module.exports = {
   edition: "production",
   Env: "prod", // // 测试环境 dev |  正式环境 prod
-  baseUrl: "http://114.135.61.188:18093/sc-login/", // 项目地址
+  baseUrl: "http://114.135.61.188:18093/sc-system/", // 项目地址
   baseApi: "http://114.135.61.187:38081", // 本地api请求地址
   baseMapApi: "http://114.135.61.187:38082", // arcgis API
   baseImgApi: "http://114.135.61.187:38082", // 图片api请求地址

+ 10 - 0
userCenter/src/views/system/users/popups/AddOrEditUserInfo.vue

@@ -265,6 +265,16 @@ export default {
                         prop: 'phone',
                         input: true
                     },
+                    {
+                        label: '密码',
+                        prop: 'password',
+                        slot: 'password'
+                    },
+                    {
+                        label: '确认密码',
+                        prop: 'passwordOK',
+                        slot: 'passwordOK'
+                    },
                     {
                         label: '头像',
                         prop: 'photo',

+ 52 - 16
userCenter/src/views/system/users/popups/edituser.vue

@@ -9,6 +9,8 @@
 <template>
     <div class="alert-body__main_content">
         <zz-form :cols="formCols" :data="formData" :rules="formRules" :errors="formErrors" labelWidth="110" ref="form">
+            <el-input slot="password" type="password" v-model="formData.password"></el-input>
+            <el-input slot="passwordOK" type="password" v-model="formData.passwordOK"></el-input>
             <el-select slot="status" v-model="formData.enableState">
                 <el-option v-for="(item, index) in allStatus" :key="index" :label="item.label" :value="item.id">{{ item.label }}</el-option>
             </el-select>
@@ -26,7 +28,7 @@
                 :props="defaultProps"
                 slot="companyOrgId"
                 class="new-select-tree"
-                selectTreeTitle='组织机构'
+                selectTreeTitle="组织机构"
                 width="320"
                 treeWidth="320"
                 :options="organListCompany"
@@ -38,7 +40,7 @@
                 :props="defaultProps"
                 slot="deptOrgId"
                 class="new-select-tree"
-                selectTreeTitle='组织机构'
+                selectTreeTitle="组织机构"
                 width="320"
                 treeWidth="320"
                 :options="organListdepartment"
@@ -78,12 +80,15 @@
                         </span>
                     </span>
                 </div>
-                <div class="tips"><img  style="width:12px;height:12px;vertical-align: middle;" src="@assets/img/icon-warning.png"/><span>支持jpg,jpeg,gif,png,bmp格式的图片</span></div>
+                <div class="tips">
+                    <img style="width: 12px; height: 12px; vertical-align: middle" src="@assets/img/icon-warning.png" /><span
+                        >支持jpg,jpeg,gif,png,bmp格式的图片</span
+                    >
+                </div>
             </el-upload>
             <el-dialog :visible.sync="dialogVisible">
                 <img width="100%" :src="dialogImageUrl" alt="" />
             </el-dialog>
-            
         </zz-form>
     </div>
 </template>
@@ -97,6 +102,27 @@ export default {
     },
 
     data() {
+        var validatePassContrast = (rule, value, callback) => {
+            if (value === '') {
+                callback(new Error('请输入密码'));
+            } else {
+                if (this.formData.password !== value) {
+                    callback(new Error('两次密码不一致'));
+                }
+                callback();
+            }
+        };
+        var validatePass = (rule, value, callback) => {
+            if (value === '') {
+                callback(new Error('请输入密码'));
+            } else {
+                if (value.length < 6) {
+                    callback(new Error('密码位数不得少于6位'));
+                }
+                callback();
+            }
+        };
+
         return {
             token: {
                 [localStorage.getItem('SC_token') && 'Authorization']: 'Bearer ' + localStorage.getItem('SC_token')
@@ -112,9 +138,9 @@ export default {
                     display: true
                 }
             ],
-            organListCompany:[],
-            organListdepartment:[],
-            phoneNumber:'',
+            organListCompany: [],
+            organListdepartment: [],
+            phoneNumber: '',
             defaultProps: {
                 value: 'id', // 唯一标识
                 label: 'orgName', // 标签显示
@@ -170,6 +196,16 @@ export default {
                         prop: 'phone',
                         input: true
                     },
+                    {
+                        label: '密码',
+                        prop: 'password',
+                        slot: 'password'
+                    },
+                    {
+                        label: '确认密码',
+                        prop: 'passwordOK',
+                        slot: 'passwordOK'
+                    },
                     {
                         label: '头像',
                         prop: 'photo',
@@ -189,8 +225,9 @@ export default {
             ],
             formRules: {
                 companyOrgId: [this.$valid.selectRequired('所属公司')],
-                // deptOrgId: [this.$valid.selectRequired('所属部门')],
                 username: [this.$valid.inputRequired('用户名')],
+                password: [{ required: true, validator: validatePass, trigger: 'blur' }],
+                passwordOK: [{ required: true, validator: validatePassContrast, trigger: 'blur' }],
                 phone: [this.$valid.patternPhone()],
                 enableState: [this.$valid.inputRequired('状态')]
             },
@@ -216,20 +253,20 @@ export default {
                         loading.close();
                         if (0 == status) {
                             this.$message.success(msg);
-                            if(this.phoneNumber!==this.formData.phone){
+                            if (this.phoneNumber !== this.formData.phone) {
                                 this.$alert('你的手机号已变更,需重新登录', '提示', {
                                     confirmButtonText: '确定',
-                                    showClose:false,
-                                }).then(()=>{
+                                    showClose: false
+                                }).then(() => {
                                     window.open('http://114.135.61.188:18093/sc-login/', '_self');
                                     window.relogin = false;
                                     localStorage.removeItem('SC_token');
                                     return;
                                 });
-                            }else{
+                            } else {
                                 this.params.callback && this.params.callback();
                                 this.$emit('close');
-                                if(this.$route.path==='/userInfo'){
+                                if (this.$route.path === '/userInfo') {
                                     this.$router.go(0);
                                 }
                             }
@@ -254,7 +291,7 @@ export default {
     created() {
         this.getselectAll();
         // this.getcompanyTree();
-        this.phoneNumber=this.params.data.phone;
+        this.phoneNumber = this.params.data.phone;
         this.formData = this.params.data ? this.params.data : this.formData;
         this.organList = this.params.organList ? this.params.organList : this.organList;
         this.organListCompany = this.params.organListCompany ? this.params.organListCompany : this.organListCompany;
@@ -315,7 +352,7 @@ export default {
     top: 0;
     right: 0;
     font-size: 12px;
-    color: #7D7F87;
+    color: #7d7f87;
     // font-size: 12px;
     // span{
     //     position: absolute;
@@ -326,6 +363,5 @@ export default {
     //     right: 0px;
     // }
 }
-    
 </style>