Commit b90dc626 by wusiyi

feat: 收款账户新增支付宝授权

parent ffd808ca
......@@ -78,3 +78,8 @@ export function sendEmailCodeApi(email, operateType) {
`/sysSecuritySettings/sendEmailCode?email=${email}&operateType=${operateType}`
)
}
// 收款账户管理 获取授权链接
export function getAuthLinkApi(id) {
return axios.get(`/baseProceedsAccount/authData?id=${id}`)
}
......@@ -148,7 +148,7 @@
:min="1"
type="number" />
</el-form-item>
<el-form-item label="启用状态" prop="isEnable">
<!-- <el-form-item label="启用状态" prop="isEnable">
<el-switch
class="switchStyle"
:width="100"
......@@ -158,7 +158,7 @@
@change="dialogEnableChange"
active-text="启用"
inactive-text="禁用"></el-switch>
</el-form-item>
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="default" @click="addDialog = false" size="small">
......@@ -420,7 +420,8 @@ import {
deleteBaseProceedsAccountApi,
sendPhoneCodeApi,
sendEmailCodeApi,
getBusinessTypeListApi
getBusinessTypeListApi,
getAuthLinkApi
} from '@/common/api/user/user.js'
export default {
......@@ -623,7 +624,10 @@ export default {
key: 'appAuthToken',
width: '150',
render: (item) => {
if (item.accountType !== 'alipay') {
if (
item.accountType !== 'alipay' ||
item.receiverType === 'belowLine'
) {
return null
}
if (item.appAuthToken) {
......@@ -632,7 +636,7 @@ export default {
return (
<el-link
type="danger"
href="https://openauth.alipay.com/oauth2/appToAppAuth.htm?app_id=2018022802291295&redirect_uri=https://qcze70557268.vicp.fun/api/manage/rest/ali/auth&state=14"
onClick={() => this.handleAuth(item.id)}
target="_blank">
未授权,点击授权
</el-link>
......@@ -925,8 +929,9 @@ export default {
if (this.setVerificationMethod()) {
// 未授权支付宝不可启用账户
if (
flag === false &&
row.isEnable === false &&
row.accountType === 'alipay' &&
row.receiverType === 'onLine' &&
!row.appAuthToken
) {
this.$message.warning('请先授权支付宝')
......@@ -967,9 +972,10 @@ export default {
}
},
// 新增/编辑 账户类型变化
accountTypeChange() {
if (this.addFormData.accountType === 'alipay') {
this.addFormData.isEnable = false
accountTypeChange(value) {
if (this.addFormData.isEnable === true) {
this.addFormData.accountType = this.currentRow.accountType
this.$message.warning('请先将账户设置为禁用状态,再修改账户类型')
}
},
// 新增/编辑 启用状态变化
......@@ -1119,6 +1125,13 @@ export default {
}
}
)
},
// 获取授权链接
async handleAuth(id) {
const res = await getAuthLinkApi(id)
if (res.code === 200) {
window.open(res.message, '_blank')
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment