Przeglądaj źródła

登录 bug 修复

冯诚 2 lat temu
rodzic
commit
b527f453e4

+ 1 - 1
index.html

@@ -8,7 +8,7 @@
   </head>
   <body ontouchstart="">
     <div id="app"></div>
-    <script src="https://connect.facebook.net/en_US/sdk.js" async defer crossorigin="anonymous"></script>
+    <script src="https://connect.facebook.net/en_US/sdk.js#appId=683963442752208&cookie=true&version=v13.0" async defer crossorigin="anonymous"></script>
     <script src="https://accounts.google.com/gsi/client" async defer></script>
     <script type="module" src="/src/main.ts"></script>
   </body>

+ 8 - 0
src/pages/my-order/index.vue

@@ -236,6 +236,14 @@ export default defineComponent({
         margin-right: 26px;
       }
     }
+    @include media-breakpoint-down(md) {
+      .ptc-button {
+        width: 48%;
+        + .ptc-button {
+          margin-right: 4%;
+        }
+      }
+    }
   }
 
   @include media-breakpoint-up(xl) {

+ 8 - 0
src/pages/repaire/index.scss

@@ -285,6 +285,14 @@
         margin-left: 26px;
       }
     }
+    @include media-breakpoint-down(md) {
+      .ptc-button {
+        width: 48%;
+        + .ptc-button {
+          margin-left: 4%;
+        }
+      }
+    }
   }
   @include media-breakpoint-up(md) {
     .inner {

+ 6 - 1
src/service/user.ts

@@ -29,7 +29,12 @@ export function updateUserInfo(data: ApiUser.Update.Request) {
 }
 
 export function getUserInfo(reportError?: boolean) {
-  return request.get<ApiUser.Info.Response>('/user/info', { reportError })
+  return request.get<ApiUser.Info.Response>('/user/info', {
+    reportError,
+    headers: {
+      'Cache-Control': 'no-cache',
+    },
+  })
 }
 
 export function inviteFriends(emails: string) {

+ 6 - 9
src/utils/third-login.ts

@@ -2,28 +2,25 @@ import AsyncTask from './asyncTask'
 
 const gTask = new AsyncTask()
 
-window.fbAsyncInit = () => {
+/* window.fbAsyncInit = () => {
   FB.init({
     appId: '683963442752208',
     cookie: true, // Enable cookies to allow the server to access the session.
-    xfbml: true, // Parse social plugins on this webpage.
     version: 'v13.0',
   })
+} */
 
-  // FB.getLoginStatus(statusChangeCallback)
-}
-
-function statusChangeCallback(response: any) {
+function fbStatusChangeCallback(response: any) {
   // Called with the results from FB.getLoginStatus().
   console.log('statusChangeCallback')
   console.log(response) // The current login status of the person.
   if (response.status === 'connected') {
     // Logged into your webpage and Facebook.
-    testAPI()
+    fbConnect()
   }
 }
 
-function testAPI() {
+function fbConnect() {
   // Testing Graph API after login.  See statusChangeCallback() for when this call is made.
   FB.api('/me?fields=id,name,email', function (response: any) {
     console.log(response)
@@ -36,7 +33,7 @@ function testAPI() {
 }
 
 export function FBLogin() {
-  FB.login(statusChangeCallback, { scope: 'public_profile,email' })
+  FB.login(fbStatusChangeCallback, { scope: 'public_profile,email' })
 }
 
 export function AppleLogin() {