tangning пре 2 година
родитељ
комит
6a528465c8
3 измењених фајлова са 2 додато и 3 уклоњено
  1. 1 1
      src/api/index.ts
  2. 1 1
      src/store/modules/user.ts
  3. 0 1
      src/utils/request.ts

+ 1 - 1
src/api/index.ts

@@ -137,5 +137,5 @@ export function wxLogin(code) {
   });
 }
 export interface wxLoginRus {
-  openid: number | string;
+  openid: string;
 }

+ 1 - 1
src/store/modules/user.ts

@@ -37,7 +37,7 @@ export const useUserStore = defineStore({
     setWxOpenId(code: string){
       wxLogin(code).then(res => {
         console.log('wxlogin',res)
-        let { openid } = res 
+        let { openid } = res.data 
         this.wxOpenId = openid ? openid : '';
         if(openid){
           useCookies().set('wxOpenId', openid)

+ 0 - 1
src/utils/request.ts

@@ -7,7 +7,6 @@ interface ResponseData<T = any> {
   code: number;
   message: string;
   data: T;
-  openid?:string
 }
 let loadingCount = 0
 const MODE = import.meta.env.MODE; // 环境变量