Commit b90dc626 by wusiyi

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

parent ffd808ca
...@@ -78,3 +78,8 @@ export function sendEmailCodeApi(email, operateType) { ...@@ -78,3 +78,8 @@ export function sendEmailCodeApi(email, operateType) {
`/sysSecuritySettings/sendEmailCode?email=${email}&operateType=${operateType}` `/sysSecuritySettings/sendEmailCode?email=${email}&operateType=${operateType}`
) )
} }
// 收款账户管理 获取授权链接
export function getAuthLinkApi(id) {
return axios.get(`/baseProceedsAccount/authData?id=${id}`)
}
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
:min="1" :min="1"
type="number" /> type="number" />
</el-form-item> </el-form-item>
<el-form-item label="启用状态" prop="isEnable"> <!-- <el-form-item label="启用状态" prop="isEnable">
<el-switch <el-switch
class="switchStyle" class="switchStyle"
:width="100" :width="100"
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
@change="dialogEnableChange" @change="dialogEnableChange"
active-text="启用" active-text="启用"
inactive-text="禁用"></el-switch> inactive-text="禁用"></el-switch>
</el-form-item> </el-form-item> -->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="default" @click="addDialog = false" size="small"> <el-button type="default" @click="addDialog = false" size="small">
...@@ -420,7 +420,8 @@ import { ...@@ -420,7 +420,8 @@ import {
deleteBaseProceedsAccountApi, deleteBaseProceedsAccountApi,
sendPhoneCodeApi, sendPhoneCodeApi,
sendEmailCodeApi, sendEmailCodeApi,
getBusinessTypeListApi getBusinessTypeListApi,
getAuthLinkApi
} from '@/common/api/user/user.js' } from '@/common/api/user/user.js'
export default { export default {
...@@ -623,7 +624,10 @@ export default { ...@@ -623,7 +624,10 @@ export default {
key: 'appAuthToken', key: 'appAuthToken',
width: '150', width: '150',
render: (item) => { render: (item) => {
if (item.accountType !== 'alipay') { if (
item.accountType !== 'alipay' ||
item.receiverType === 'belowLine'
) {
return null return null
} }
if (item.appAuthToken) { if (item.appAuthToken) {
...@@ -632,7 +636,7 @@ export default { ...@@ -632,7 +636,7 @@ export default {
return ( return (
<el-link <el-link
type="danger" 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"> target="_blank">
未授权,点击授权 未授权,点击授权
</el-link> </el-link>
...@@ -925,8 +929,9 @@ export default { ...@@ -925,8 +929,9 @@ export default {
if (this.setVerificationMethod()) { if (this.setVerificationMethod()) {
// 未授权支付宝不可启用账户 // 未授权支付宝不可启用账户
if ( if (
flag === false && row.isEnable === false &&
row.accountType === 'alipay' && row.accountType === 'alipay' &&
row.receiverType === 'onLine' &&
!row.appAuthToken !row.appAuthToken
) { ) {
this.$message.warning('请先授权支付宝') this.$message.warning('请先授权支付宝')
...@@ -967,9 +972,10 @@ export default { ...@@ -967,9 +972,10 @@ export default {
} }
}, },
// 新增/编辑 账户类型变化 // 新增/编辑 账户类型变化
accountTypeChange() { accountTypeChange(value) {
if (this.addFormData.accountType === 'alipay') { if (this.addFormData.isEnable === true) {
this.addFormData.isEnable = false this.addFormData.accountType = this.currentRow.accountType
this.$message.warning('请先将账户设置为禁用状态,再修改账户类型')
} }
}, },
// 新增/编辑 启用状态变化 // 新增/编辑 启用状态变化
...@@ -1119,6 +1125,13 @@ export default { ...@@ -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