Browse Source

getUserInfo接口支持[tokenName]自定义

chuzhixin 4 years ago
parent
commit
ceed4db65b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/api/user.js

+ 2 - 2
src/api/user.js

@@ -1,6 +1,6 @@
 import request from "@/utils/request";
 import { encryptedData } from "@/utils/encrypt";
-import { loginRSA } from "@/config/settings";
+import { loginRSA, tokenName } from "@/config/settings";
 
 export async function login(data) {
   if (loginRSA) {
@@ -18,7 +18,7 @@ export function getUserInfo(accessToken) {
     url: "/userInfo",
     method: "post",
     data: {
-      accessToken,
+      [tokenName]: accessToken,
     },
   });
 }