Commit e21bcd67 authored by 郝聪敏's avatar 郝聪敏

fix: 处理accessToken

parent d794a70b
......@@ -9,9 +9,13 @@ export function getCaptcha() {
}
export function login(params) {
return http.post(`${opapiHost}/backStms/prologue/login`, qs.stringify(params));
return http.post(`${opapiHost}/backStms/prologue/login`, qs.stringify(params), {
accessToken: true
});
}
export function getUserInfo() {
return http.get(`${opapiHost}/backStms/oauth/currentuserinfo`);
return http.get(`${opapiHost}/backStms/oauth/currentuserinfo`, {
accessToken: true
});
}
\ No newline at end of file
......@@ -18,11 +18,11 @@
</template>
<style>
html {
font-size: 10vw;
font-size: 10vw !important;
}
@media screen and (min-width: 768Px) {
html {
font-size: 37.5Px;
font-size: 37.5Px !important;
}
body {
max-width: 375Px;
......
......@@ -327,6 +327,8 @@ export default {
}
}
&-submit {
height: 50px !important;
border-radius: 8px !important;
border: 0 !important;
}
}
......
......@@ -63,7 +63,7 @@ instance.interceptors.request.use(
const token = localStorage.get('token');
if (token) {
config.headers['X-Auth-Token'] = token;
config.headers['Access-Token'] = token;
if (config.accessToken) { config.headers['Access-Token'] = token; }
}
return config;
......
import { AxiosRequestConfig } from 'axios';
declare var window: Window;
declare var EASY_ENV_IS_NODE: boolean;
......@@ -5,3 +7,8 @@ interface Window {
__INITIAL_STATE__: any;
}
declare module 'axios' {
export interface AxiosRequestConfig {
accessToken?: boolean;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment