소스 검색

供应商子账号接口功能调试

yuwenjun1997 2 년 전
부모
커밋
6a2e04f483

+ 4 - 13
src/components/QrcodeClub/index.vue

@@ -34,12 +34,12 @@ export default {
   data() {
     return {
       imgUrl: '',
-      wwwServer: process.env.VUE_APP_WWW_HOST,
+      wwwHost: process.env.VUE_APP_WWW_HOST,
       qrcodePath: ''
     }
   },
   computed: {
-    ...mapGetters(['authUserId', 'name'])
+    ...mapGetters(['authUserId', 'name', 'prefix'])
   },
   created() {
     this.initQrcode()
@@ -63,12 +63,7 @@ export default {
     },
     // 初始化二维码
     async initQrcode() {
-      console.log(this.qrcodeData)
-      this.qrcodePath = `${this.wwwServer}/${this.authUserId}/app/approve/club/detail?id=${this.qrcodeData.authId}`
-      if (this.authUserId === 12) {
-        this.qrcodePath = `${this.wwwServer}/${this.authUserId}/ross/approve/club/detail?id=${this.qrcodeData.authId}`
-      }
-      console.log(this.qrcodePath)
+      this.qrcodePath = `${this.wwwHost}/${this.qrcodeData.authUserId}/${this.prefix}/approve/club/detail?id=${this.qrcodeData.authId}`
       // 二维码配置
       const options = {
         width: 192,
@@ -83,11 +78,7 @@ export default {
     },
     // 生成下载的文件
     async createDownFile(callback) {
-      this.qrcodePath = `${this.wwwServer}/${this.authUserId}/app/approve/club/detail?id=${this.qrcodeData.authId}`
-      if (this.authUserId === 12) {
-        this.qrcodePath = `${this.wwwServer}/${this.authUserId}/ross/approve/club/detail?id=${this.qrcodeData.authId}`
-      }
-      console.log(this.qrcodePath)
+      this.qrcodePath = `${this.wwwHost}/${this.qrcodeData.authUserId}/${this.prefix}/approve/club/detail?id=${this.qrcodeData.authId}`
       const strHeader = this.name + '正品授权'
       const strFooter = this.qrcodeData.authParty
       // 生成二维码参数信息

+ 6 - 4
src/components/QrcodeDevice/index.vue

@@ -40,7 +40,7 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['authUserId'])
+    ...mapGetters(['authUserId', 'prefix'])
   },
   created() {
     this.initQrcode()
@@ -64,12 +64,13 @@ export default {
     },
     // 初始化二维码
     async initQrcode() {
-      console.log(this.productInfo)
+      // this.qrcodePath = `${this.wwwHost}/${this.productInfo.authUserId}/${this.prefix}/approve/device/detail?id=${this.productInfo?.productId}`
       if (this.authUserId === 12) {
-        this.qrcodePath = `${this.wwwHost}/12/ross/approve/device/detail?id=${this.productInfo?.productId}`
+        this.qrcodePath = `${this.wwwHost}/${this.productInfo.authUserId}/${this.prefix}/approve/device/detail?id=${this.productInfo?.productId}`
       } else {
         this.qrcodePath = `${this.wwwServer}/product/auth/product-${this.productInfo?.productId}.html`
       }
+      console.log(this.qrcodePath)
       // 二维码配置
       const options = {
         width: 192,
@@ -84,8 +85,9 @@ export default {
     },
     // 生成下载的文件
     async createDownFile(callback) {
+      // this.qrcodePath = `${this.wwwHost}/${this.productInfo.authUserId}/${this.prefix}/approve/device/detail?id=${this.productInfo?.productId}`
       if (this.authUserId === 12) {
-        this.qrcodePath = `${this.wwwHost}/12/ross/approve/device/detail?id=${this.productInfo?.productId}`
+        this.qrcodePath = `${this.wwwHost}/${this.productInfo.authUserId}/${this.prefix}/approve/device/detail?id=${this.productInfo?.productId}`
       } else {
         this.qrcodePath = `${this.wwwServer}/product/auth/product-${this.productInfo?.productId}.html`
       }

+ 2 - 2
src/views/normal/club/cate/edit.vue

@@ -14,7 +14,7 @@
           @remove="onUploadImageRemove"
         />
       </el-form-item>
-      <el-form-item v-if="shopType === 2" label="所属品牌:" prop="infoId">
+      <el-form-item label="所属品牌:" prop="infoId">
         <el-select v-model="formData.infoId" placeholder="请选择品牌" style="width: 100%" filterable clearable>
           <el-option v-for="item in brandList" :key="item.infoId" :label="item.brandName" :value="item.infoId" />
         </el-select>
@@ -167,7 +167,7 @@ export default {
     // 获取品牌信息
     async getBrandList() {
       try {
-        const { data } = await fetchBrandList({ type: 3, authUserId: this.authUserId })
+        const { data } = await fetchBrandList()
         this.brandList = data
       } catch (error) {
         console.log(error)

+ 1 - 1
src/views/normal/club/device/edit.vue

@@ -41,7 +41,7 @@
 
       <template v-if="formData.authType === 1 || (formData.authType === 2 && formData.snCode)">
         <!-- **************** 新方法配置授权牌 START ******************* -->
-        <el-form-item label="授权牌:" prop="certificateImage">
+        <el-form-item label="授权牌:">
           <el-radio-group v-model="formData.certificateImageType" size="mini" @change="onCertificateImageTypeChange">
             <el-radio :label="1" border>模板库生成</el-radio>
             <el-radio :label="2" border>自定义上传</el-radio>

+ 2 - 4
src/views/normal/club/index.vue

@@ -168,7 +168,6 @@ import { fecthAuthList, changeAuthStatus, removeAuth, authImportExcel, setStarCl
 import { mapGetters } from 'vuex'
 import { debounce, downloadWithUrl } from '@/utils/tools'
 import handleClipboard from '@/utils/clipboard'
-import { routePrefixMap } from '@/utils/config'
 export default {
   name: 'ComplexTable',
   components: { FileUpload, QrcodeClub, ClubListSelector },
@@ -214,7 +213,7 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['authUserId', 'userIdentity', 'copyUserInfo']),
+    ...mapGetters(['authUserId', 'userIdentity', 'copyUserInfo', 'prefix']),
     saveBtnClickable() {
       return this.uploadFileList.length > 0
     }
@@ -259,9 +258,8 @@ export default {
           .then(() => {})
           .catch(() => {})
       }
-      const routePrefix = routePrefixMap[this.authUserId] ? routePrefixMap[this.authUserId] : `/${this.authUserId}/app`
       handleClipboard(
-        `${process.env.VUE_APP_WWW_HOST}${routePrefix}/form/club-bind?authId=${row.authId}`,
+        `${process.env.VUE_APP_WWW_HOST}/${row.authUserId}/${this.prefix}/form/club-bind?authId=${row.authId}`,
         '链接已复制到粘贴板',
         $event
       )

+ 8 - 8
src/views/normal/settings/accounts/edit.vue

@@ -5,8 +5,8 @@
         <el-input v-show="false" v-model="user.avatar" />
         <upload-image tip="建议尺寸:60 * 60px" />
       </el-form-item> -->
-      <el-form-item label="登录名:" prop="username">
-        <el-input v-model="userInfo.username" :placeholder="`通过登录名登录时请加上前缀,例如:${prefix}_test`">
+      <el-form-item label="登录名:" prop="loginAccount">
+        <el-input v-model="userInfo.loginAccount" :placeholder="`通过登录名登录时请加上前缀,例如:${prefix}_test`">
           <template slot="prepend">{{ prefix }}_</template>
         </el-input>
       </el-form-item>
@@ -79,7 +79,7 @@ export default {
       editType: 'add',
       userInfo: {
         id: 0,
-        username: '',
+        loginAccount: '',
         password: '',
         linkMan: '',
         mobile: '',
@@ -89,7 +89,7 @@ export default {
       },
       roleList: [],
       rules: {
-        username: [
+        loginAccount: [
           { required: true, message: '登录名不能为空', trigger: 'blur' },
           { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
         ],
@@ -125,7 +125,7 @@ export default {
     updateUserInfo() {
       const userInfo = deepClone(this.userInfo)
       userInfo.roleIds = userInfo.roleList.join(',')
-      userInfo.username = `${this.prefix}_${userInfo.username}`
+      userInfo.loginAccount = `${this.prefix}_${userInfo.loginAccount}`
       updateUser(userInfo.id, userInfo).then((res) => {
         this.$message.success('修改用户成功')
         this.$store.dispatch('tagsView/delView', this.$route)
@@ -136,7 +136,7 @@ export default {
     createUserInfo() {
       const userInfo = deepClone(this.userInfo)
       userInfo.roleIds = userInfo.roleList.join(',')
-      userInfo.username = `${this.prefix}_${userInfo.username}`
+      userInfo.loginAccount = `${this.prefix}_${userInfo.loginAccount}`
       createUser(userInfo).then((res) => {
         this.$message.success('添加用户成功')
         this.$store.dispatch('tagsView/delView', this.$route)
@@ -169,8 +169,8 @@ export default {
       }
       const prefix = this.prefix + '_'
       const prefixLen = prefix.length
-      if (this.userInfo.username.startsWith(prefix)) {
-        this.userInfo.username = this.userInfo.username.substring(prefixLen)
+      if (this.userInfo.loginAccount.startsWith(prefix)) {
+        this.userInfo.loginAccount = this.userInfo.loginAccount.substring(prefixLen)
       }
       this.userInfo.roleList = data.roleIds.split(',').map((item) => parseInt(item))
     },

+ 1 - 1
src/views/normal/settings/accounts/index.vue

@@ -37,7 +37,7 @@
           <img :src="row.avatar" class="avatar" alt="">
         </template>
       </el-table-column> -->
-      <el-table-column prop="username" label="登录名" align="center" />
+      <el-table-column prop="loginAccount" label="登录名" align="center" />
       <el-table-column prop="linkMan" label="联系人" align="center" />
       <el-table-column label="手机号" align="center">
         <template slot-scope="{row}">