xiongzhu 4 anos atrás
pai
commit
d8ea3e4e75

+ 9 - 0
src/main/java/com/izouma/nineth/service/UserService.java

@@ -440,4 +440,13 @@ public class UserService {
                 .userId(userId)
                 .build());
     }
+
+    public void removeBankCard(Long userId) throws BaseAdaPayException {
+        User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
+        if (StringUtils.isNotBlank(user.getSettleAccountId()) && StringUtils.isNotBlank(user.getMemberId())) {
+            adapayService.delSettleAccount(user.getMemberId(), user.getSettleAccountId());
+        } else {
+            throw new BusinessException("未绑定");
+        }
+    }
 }

+ 5 - 0
src/main/java/com/izouma/nineth/web/UserController.java

@@ -220,6 +220,11 @@ public class UserController extends BaseController {
     public void addBankCard(@RequestParam String bankNo, @RequestParam String phone, @RequestParam String code) throws BaseAdaPayException {
         userService.addBankCard(SecurityUtils.getAuthenticatedUser().getId(), bankNo, phone, code);
     }
+
+    @PostMapping("/removeBankCard")
+    public void removeBankCard() throws BaseAdaPayException {
+        userService.removeBankCard(SecurityUtils.getAuthenticatedUser().getId());
+    }
 }
 
 

+ 2 - 0
src/main/nine-space/.env.app

@@ -0,0 +1,2 @@
+VUE_APP_BASE_URL=https://nft.9space.vip
+NODE_ENV=app

+ 1 - 1
src/main/nine-space/src/components/product/productLarge.vue

@@ -32,7 +32,7 @@
                     <img src="../../assets/icon_jiage.png" alt="" />
                     <span> {{ info.price }}</span>
                 </div>
-                <diV v-else class="status">仅展示</diV>
+                <div v-else class="status">仅展示</div>
             </div>
         </div>
 

+ 1 - 16
src/main/nine-space/src/plugins/http.js

@@ -1,22 +1,7 @@
 import axios from 'axios';
 import qs from 'qs';
 /* eslint-disable */
-// let baseUrl = process.env.VUE_APP_BASE_URL;
-let baseUrl = 'http://localhost:8080';
-switch (process.env.NODE_ENV) {
-    case 'development':
-        baseUrl = 'https://nfttest.9space.vip/';
-        // baseUrl = 'http://192.168.50.190:8080';
-        // baseUrl = 'http://localhost:8080';
-        // baseUrl = 'http://192.168.50.190:8080';
-        break;
-    case 'test':
-        baseUrl = 'http://localhost:8080';
-        break;
-    case 'production':
-        baseUrl = '../../';
-        break;
-}
+let baseUrl = process.env.VUE_APP_BASE_URL;
 const axiosInstance = axios.create({
     baseURL: baseUrl
 });

+ 3 - 3
src/main/nine-space/src/router/index.js

@@ -1,4 +1,4 @@
-import { createRouter, createWebHistory } from 'vue-router';
+import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
 import store from '../store';
 import { Page } from './Page';
 import { Dialog } from 'vant';
@@ -42,7 +42,7 @@ function jsapiSign() {
                         });
                     });
                 })
-                .catch(e => { });
+                .catch(e => {});
         }
     }, 200);
 }
@@ -410,7 +410,7 @@ const routes = [
 ];
 
 const router = createRouter({
-    history: createWebHistory(process.env.BASE_URL),
+    history: process.env.NODE_ENV === 'app' ? createWebHashHistory() : createWebHistory(process.env.BASE_URL),
     routes,
     scrollBehavior(to, from, savedPosition) {
         return { x: 0, y: 0 };

+ 2 - 1
src/main/nine-space/vue.config.js

@@ -1,6 +1,7 @@
 const path = require('path');
+console.log(process.env.NODE_ENV);
 module.exports = {
-    publicPath: process.env.NODE_ENV === 'production' ? '/9th/' : '/',
+    publicPath: process.env.NODE_ENV === 'production' ? '/9th/' : process.env.NODE_ENV === 'app' ? './' : '/',
     devServer: {
         port: 8081,
         disableHostCheck: true

+ 1 - 1
src/test/java/com/izouma/nineth/service/AdapayServiceTest.java

@@ -63,7 +63,7 @@ public class AdapayServiceTest extends ApplicationTests {
 
     @Test
     public void delSettleAccount() throws BaseAdaPayException {
-        adapayService.delSettleAccount("99999999999999", "0288070028826880");
+        adapayService.delSettleAccount("4884", "0288850695349248");
     }
 
     @Test