Rap 原分销系统代码Web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9458a0e02359b014c3ac39631daa4c87dcaa2ca9.svn-base 3.3KB

5 maanden geleden
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <el-form ref="form" :model="form" :rules="rules" style="margin-top: 6px;" size="small" label-width="100px">
  3. <el-form-item label="appID" prop="appId">
  4. <el-input v-model="form.appId" style="width: 40%" />
  5. <span style="color: #C0C0C0;margin-left: 10px;">应用APPID,收款账号既是APPID对应支付宝账号</span>
  6. </el-form-item>
  7. <el-form-item label="商家账号" prop="sysServiceProviderId">
  8. <el-input v-model="form.sysServiceProviderId" style="width: 40%;" />
  9. <span style="color: #C0C0C0;margin-left: 10px;">商家账号</span>
  10. </el-form-item>
  11. <el-form-item label="商户私钥" prop="privateKey">
  12. <el-input v-model="form.privateKey" type="password" style="width: 40%;" />
  13. <span style="color: #C0C0C0;margin-left: 10px;">商户私钥,你的PKCS8格式RSA2私钥</span>
  14. </el-form-item>
  15. <el-form-item label="支付宝公钥" prop="publicKey">
  16. <el-input v-model="form.publicKey" type="password" style="width: 40%;" />
  17. <span style="color: #C0C0C0;margin-left: 10px;">支付宝公钥</span>
  18. </el-form-item>
  19. <el-form-item label="回调地址" prop="returnUrl">
  20. <el-input v-model="form.returnUrl" style="width: 40%;" />
  21. <span style="color: #C0C0C0;margin-left: 10px;">订单完成后返回的地址</span>
  22. </el-form-item>
  23. <el-form-item label="异步通知" prop="notifyUrl">
  24. <el-input v-model="form.notifyUrl" style="width: 40%;" />
  25. <span style="color: #C0C0C0;margin-left: 10px;">支付结果异步通知地址</span>
  26. </el-form-item>
  27. <el-form-item label="">
  28. <el-button :loading="loading" size="medium" type="primary" @click="doSubmit">保存配置</el-button>
  29. </el-form-item>
  30. </el-form>
  31. </template>
  32. <script>
  33. import { get, update } from '@/api/tools/alipay'
  34. export default {
  35. name: 'Config',
  36. data() {
  37. return {
  38. loading: false,
  39. form: { appId: '', sysServiceProviderId: '', privateKey: '', publicKey: '', returnUrl: '', notifyUrl: '' },
  40. rules: {
  41. appId: [
  42. { required: true, message: '请输入appID', trigger: 'blur' }
  43. ],
  44. sysServiceProviderId: [
  45. { required: true, message: '请输入商家账号', trigger: 'blur' }
  46. ],
  47. privateKey: [
  48. { required: true, message: '商户私钥不能为空', trigger: 'blur' }
  49. ],
  50. publicKey: [
  51. { required: true, message: '支付宝公钥不能为空', trigger: 'blur' }
  52. ],
  53. returnUrl: [
  54. { required: true, message: '回调地址不能为空', trigger: 'blur' }
  55. ],
  56. notifyUrl: [
  57. { required: true, message: '回调地址不能为空', trigger: 'blur' }
  58. ]
  59. }
  60. }
  61. },
  62. created() {
  63. this.init()
  64. },
  65. methods: {
  66. init() {
  67. get().then(res => {
  68. this.form = res
  69. })
  70. },
  71. doSubmit() {
  72. this.$refs['form'].validate((valid) => {
  73. if (valid) {
  74. this.loading = true
  75. update(this.form).then(res => {
  76. this.$notify({
  77. title: '修改成功',
  78. type: 'success',
  79. duration: 2500
  80. })
  81. this.loading = false
  82. }).catch(err => {
  83. this.loading = false
  84. console.log(err.response.data.message)
  85. })
  86. } else {
  87. return false
  88. }
  89. })
  90. }
  91. }
  92. }
  93. </script>
  94. <style scoped>
  95. </style>