瀏覽代碼

公众号支付

xiongzhu 4 年之前
父節點
當前提交
1dcffdc9d5

+ 1 - 0
src/main/java/com/izouma/nineth/security/WebSecurityConfig.java

@@ -89,6 +89,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/sysConfig/get/*").permitAll()
                 .antMatchers("/sysConfig/get/*").permitAll()
                 .antMatchers("/sysConfig/getDecimal/*").permitAll()
                 .antMatchers("/sysConfig/getDecimal/*").permitAll()
                 .antMatchers("/user/code2openId").permitAll()
                 .antMatchers("/user/code2openId").permitAll()
+                .antMatchers("/blindBoxItem/all").permitAll()
                 // all other requests need to be authenticated
                 // all other requests need to be authenticated
                 .anyRequest().authenticated().and()
                 .anyRequest().authenticated().and()
                 // make sure we use stateless session; session won't be used to
                 // make sure we use stateless session; session won't be used to

+ 0 - 5
src/main/nine-space/public/index.html

@@ -25,9 +25,4 @@
         <div id="app"></div>
         <div id="app"></div>
         <!-- built files will be auto injected -->
         <!-- built files will be auto injected -->
     </body>
     </body>
-    <script src="https://unpkg.com/vconsole/dist/vconsole.min.js"></script>
-<script>
-  // VConsole will be exported to `window.VConsole` by default.
-  var vConsole = new window.VConsole();
-</script>
 </html>
 </html>

+ 4 - 0
src/main/nine-space/src/main.js

@@ -36,4 +36,8 @@ if (query.code) {
     http.http.post('/user/code2openId', { code: query.code }).then(res => {
     http.http.post('/user/code2openId', { code: query.code }).then(res => {
         localStorage.setItem('openId', res);
         localStorage.setItem('openId', res);
     });
     });
+} else {
+    if (/micromessenger/i.test(navigator.userAgent) && /localhost|(192\.168)/i.test(location.host)) {
+        document.location.replace('https://nft.9space.vip/wx/redirect?redirectUrl=' + location.href);
+    }
 }
 }

+ 16 - 14
src/main/nine-space/src/router/index.js

@@ -6,20 +6,22 @@ import http from '../plugins/http';
 
 
 console.log(http);
 console.log(http);
 function jsapiSign() {
 function jsapiSign() {
-    http.http
-        .get('/wx/jsapiSign', { url: location.origin + location.pathname })
-        .then(res => {
-            res.debug = false;
-            res.jsApiList = [
-                'chooseWXPay',
-                'updateAppMessageShareData',
-                'updateTimelineShareData',
-                'hideAllNonBaseMenuItem',
-                'scanQRCode'
-            ];
-            wx.config(res);
-        })
-        .catch(e => {});
+    if (/micromessenger/i.test(navigator.userAgent)) {
+        http.http
+            .get('/wx/jsapiSign', { url: location.origin + location.pathname })
+            .then(res => {
+                res.debug = false;
+                res.jsApiList = [
+                    'chooseWXPay',
+                    'updateAppMessageShareData',
+                    'updateTimelineShareData',
+                    'hideAllNonBaseMenuItem',
+                    'scanQRCode'
+                ];
+                wx.config(res);
+            })
+            .catch(e => {});
+    }
 }
 }
 jsapiSign();
 jsapiSign();
 const routes = [
 const routes = [

+ 1 - 1
src/main/nine-space/src/views/Submit.vue

@@ -173,7 +173,7 @@ export default {
                                             ...res,
                                             ...res,
                                             package: res.package || res.packageValue,
                                             package: res.package || res.packageValue,
                                             timestamp: res.timeStamp,
                                             timestamp: res.timeStamp,
-                                            success: function (res) {
+                                            success(res) {
                                                 this.$toast.success('支付成功');
                                                 this.$toast.success('支付成功');
                                                 setTimeout(() => {
                                                 setTimeout(() => {
                                                     this.$router.replace('/orders');
                                                     this.$router.replace('/orders');