dist
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { getValue } from '@/utils/common';
|
||||
import axios from 'axios'
|
||||
axios.defaults.baseURL = 'https://case.sy-my.net/beelink/public/home/';
|
||||
if(getValue("time") < (new Date().getTime() - 12 * 60 * 60 * 1000)){
|
||||
localStorage.removeItem("token")
|
||||
localStorage.removeItem("time")
|
||||
}
|
||||
axios.defaults.headers.common['Authorization'] = "Bearer " + getValue("token");
|
||||
axios.defaults.headers.common['Language'] = !getValue("Lanvuage") ? 'zh' : getValue("Lanvuage");
|
||||
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
|
||||
@@ -30,6 +30,9 @@ export async function previewCover(file: any): Promise<string> {
|
||||
*/
|
||||
|
||||
export function saveValue(key: string, value: any): boolean{
|
||||
if(key == "token"){
|
||||
saveValue("time",new Date().getTime())
|
||||
}
|
||||
if(typeof value == 'object'){
|
||||
value = JSON.stringify(value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user