Procházet zdrojové kódy

'添加是否三方授权'

hjs před 1 rokem
rodič
revize
9107e47d2c

+ 2 - 2
.env.development

@@ -3,5 +3,5 @@ ENV = 'development'
 
 # base api
 # VUE_APP_BASE_API = '/dev-api'
-VUE_APP_BASE_API = 'http://192.168.11.11:8081/hanghui-server-platform'
-# VUE_APP_BASE_API = 'https://tx.hz-hanghui.com:8088/hanghui-server-platform'
+# VUE_APP_BASE_API = 'http://192.168.11.11:8081/hanghui-server-platform'
+VUE_APP_BASE_API = 'https://tx.hz-hanghui.com:8088/hanghui-server-platform'

+ 10 - 10
src/views/merchant/index.vue

@@ -45,28 +45,28 @@
       </el-table-column>
       <el-table-column label="是否第三方应用" align="center" width="120">
         <template slot-scope="scope">
-          <el-tag :type="scope.row.thirdAuthAppId | statusFilter">
-            {{ scope.row.thirdAuthAppId ? '是' : '否' }}
+          <el-tag :type="scope.row.thirdAuth | statusFilter">
+            {{ scope.row.thirdAuth ? '是' : '否' }}
           </el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="三方授权appId">
+      <!-- <el-table-column label="三方授权appId">
         <template slot-scope="scope">
           {{ scope.row.thirdAuthAppId }}
         </template>
-      </el-table-column>
-      <!-- <el-table-column label="授权token">
+      </el-table-column> -->
+      <el-table-column label="三方授权token">
         <template slot-scope="scope">
           {{ scope.row.appAuthToken }}
         </template>
-      </el-table-column> -->
-      <el-table-column label="授权状态" align="center" class-name="status-col" width="100">
+      </el-table-column>
+      <!-- <el-table-column label="授权状态" align="center" class-name="status-col" width="100">
         <template slot-scope="{row}">
-          <el-tag :type="(row.thirdAuthAppId ? (row.appAuthTokenStatus ? true : false) : false) | statusFilter">
+          <el-tag :type="(row.thirdAuth ? (row.appAuthTokenStatus ? true : false) : false) | statusFilter">
             {{ row | statusFilterStr }}
           </el-tag>
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
         <template slot-scope="{row,$index}">
           <el-button type="primary" size="mini" @click="handleUpdate(row)">
@@ -106,7 +106,7 @@ export default {
       return status ? 'success' : 'info'
     },
     statusFilterStr(obj) {
-      return obj.thirdAuthAppId ? (obj.appAuthTokenStatus ? '已授权' : '未授权') : '未启用'
+      return obj.thirdAuth ? (obj.appAuthTokenStatus ? '已授权' : '未授权') : '未启用'
     }
   },
   mixins: [tableMixins],

+ 9 - 11
src/views/merchant/modal/AddModal.vue

@@ -22,14 +22,14 @@
       <el-form-item label="商户平台地址" prop="serviceAddress" required>
         <el-input v-model="form.serviceAddress" />
       </el-form-item>
-      <el-form-item label="是否三方应用" required>
-        <el-radio-group v-model="isThirdApp">
+      <el-form-item label="是否三方应用" prop="thirdAuth" required>
+        <el-radio-group v-model="form.thirdAuth">
           <el-radio :label="false">否</el-radio>
           <el-radio :label="true">是</el-radio>
         </el-radio-group>
       </el-form-item>
-      <el-form-item v-if="isThirdApp" label="三方授权appId" prop="thirdAuthAppId" required>
-        <el-input v-model="form.thirdAuthAppId" />
+      <el-form-item v-if="form.thirdAuth" label="三方授权token" prop="appAuthToken" required>
+        <el-input v-model="form.appAuthToken" />
       </el-form-item>
     </el-form>
     <div slot="footer" class="dialog-footer">
@@ -49,14 +49,14 @@ import { add } from '@/api/merchant'
 export default {
   data() {
     return {
-      isThirdApp: false,
       form: {
         id: null,
         machineAppId: null,
         name: null,
         serviceAddress: null,
         serviceAppId: null,
-        thirdAuthAppId: null
+        thirdAuth: false,
+        appAuthToken: null
       },
       rules: {
         machineAppId: [
@@ -71,7 +71,7 @@ export default {
         serviceAppId: [
           { required: true, whitespace: true, message: '不能为空!', trigger: ['change', 'blur'] }
         ],
-        thirdAuthAppId: [
+        appAuthToken: [
           { required: true, whitespace: true, message: '不能为空!', trigger: ['change', 'blur'] }
         ]
       },
@@ -89,10 +89,8 @@ export default {
         if (obj && Object.keys(obj).length > 0) {
           this.form = obj
           this.isEdit = true
-          this.isThirdApp = !!this.form.thirdAuthAppId
         } else {
           this.isEdit = false
-          this.isThirdApp = false
         }
       })
     },
@@ -107,8 +105,8 @@ export default {
         }
         this.submitLoading = true
         try {
-          if (!this.isThirdApp) {
-            this.form.thirdAuthAppId = null
+          if (!this.form.thirdAuth) {
+            this.form.appAuthToken = null
           }
           await add(this.form)
           this.visible = false