AI 1 mesiac pred
rodič
commit
375ea4f239
1 zmenil súbory, kde vykonal 21 pridanie a 1 odobranie
  1. 21 1
      src/views/news/addGood.vue

+ 21 - 1
src/views/news/addGood.vue

@@ -26,7 +26,7 @@
             <el-cascader :key="cascaderKey" v-model="form.city_arr_id" placeholder="发布地区:" :props="cityData" filterable
             <el-cascader :key="cascaderKey" v-model="form.city_arr_id" placeholder="发布地区:" :props="cityData" filterable
               clearable></el-cascader>
               clearable></el-cascader>
           </el-form-item>
           </el-form-item>
-          <el-form-item label="网站:" prop="website_id" class="custom-align-right">
+          <el-form-item label="网站:" prop="website_id" class="custom-align-right" v-if="userType != 10000">
             <el-select v-model="form.website_id" placeholder="请选择网站" filterable clearable>
             <el-select v-model="form.website_id" placeholder="请选择网站" filterable clearable>
               <el-option v-for="item in websiteOptions" :key="item.value" :label="item.label" :value="item.value">
               <el-option v-for="item in websiteOptions" :key="item.value" :label="item.label" :value="item.value">
               </el-option>
               </el-option>
@@ -227,6 +227,7 @@ export default {
     let self = this;
     let self = this;
     //0.全局操作 end ------------------------------------------------------------>
     //0.全局操作 end ------------------------------------------------------------>
     return {
     return {
+      userType: 0,
       websiteOptions: [],
       websiteOptions: [],
       checked: false,
       checked: false,
       formLabelWidth: '80px',//表单的长度
       formLabelWidth: '80px',//表单的长度
@@ -476,6 +477,24 @@ export default {
         console.error('获取网站列表失败:', error);
         console.error('获取网站列表失败:', error);
       }
       }
     },
     },
+    //获取用户身份信息
+    getUserInfo() {
+      this.$store.dispatch('public/getInfo').then(res => {
+        console.log(res)
+        this.userType = res.data.type_id;
+        if (this.userType == 10000) {
+          this.form.website_id = res.data.website_id !== undefined ? res.data.website_id : 2;;
+        }
+        //if(res.data.type_id==10000){}//管理员
+        //if(res.data.type_id==4){}//调研员
+        //个人会员=1 政务会员=2 企业会员=3 调研员=4 管理员=10000 游客=20000
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '网络错误,请重试!'
+        });
+      })
+    },
     //1.提交表单 start ------------------------------------------------------------>
     //1.提交表单 start ------------------------------------------------------------>
     beforeAvatarUpload(file) {
     beforeAvatarUpload(file) {
       const isJPG = file.type === 'image/jpeg';
       const isJPG = file.type === 'image/jpeg';
@@ -885,6 +904,7 @@ export default {
       console.log("添加商品!")
       console.log("添加商品!")
     }
     }
     this.fetchWebsiteOptions();
     this.fetchWebsiteOptions();
+    this.getUserInfo();
 
 
     //复制内容到富文本 start ------------------------------------------------------------>
     //复制内容到富文本 start ------------------------------------------------------------>
     this.$nextTick(() => {
     this.$nextTick(() => {