refactor: eslint代码检查优化
Former-commit-id: 4c11b5d0cdd10f28148cf3d9b593f85e082cdc51
This commit is contained in:
@@ -31,17 +31,17 @@ export function removeClass(ele: HTMLElement, cls: string) {
|
||||
|
||||
export function mix(color1: string, color2: string, weight: number) {
|
||||
weight = Math.max(Math.min(Number(weight), 1), 0);
|
||||
let r1 = parseInt(color1.substring(1, 3), 16);
|
||||
let g1 = parseInt(color1.substring(3, 5), 16);
|
||||
let b1 = parseInt(color1.substring(5, 7), 16);
|
||||
let r2 = parseInt(color2.substring(1, 3), 16);
|
||||
let g2 = parseInt(color2.substring(3, 5), 16);
|
||||
let b2 = parseInt(color2.substring(5, 7), 16);
|
||||
let r = Math.round(r1 * (1 - weight) + r2 * weight);
|
||||
let g = Math.round(g1 * (1 - weight) + g2 * weight);
|
||||
let b = Math.round(b1 * (1 - weight) + b2 * weight);
|
||||
const r1 = parseInt(color1.substring(1, 3), 16);
|
||||
const g1 = parseInt(color1.substring(3, 5), 16);
|
||||
const b1 = parseInt(color1.substring(5, 7), 16);
|
||||
const r2 = parseInt(color2.substring(1, 3), 16);
|
||||
const g2 = parseInt(color2.substring(3, 5), 16);
|
||||
const b2 = parseInt(color2.substring(5, 7), 16);
|
||||
const r = Math.round(r1 * (1 - weight) + r2 * weight);
|
||||
const g = Math.round(g1 * (1 - weight) + g2 * weight);
|
||||
const b = Math.round(b1 * (1 - weight) + b2 * weight);
|
||||
const rStr = ("0" + (r || 0).toString(16)).slice(-2);
|
||||
const gStr = ("0" + (g || 0).toString(16)).slice(-2);
|
||||
const bStr = ("0" + (b || 0).toString(16)).slice(-2);
|
||||
return "#" + rStr + gStr + bStr;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -52,10 +52,6 @@ service.interceptors.response.use(
|
||||
localStorage.clear(); // 清除浏览器全部缓存
|
||||
window.location.href = '/'; // 跳转登录页
|
||||
ElMessageBox.alert('当前页面已失效,请重新登录', '提示', {})
|
||||
.then(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
} else {
|
||||
ElMessage({
|
||||
message: msg || '系统出错',
|
||||
|
||||
@@ -34,7 +34,7 @@ const position = () => {
|
||||
* @param {number} duration
|
||||
* @param {Function} callback
|
||||
*/
|
||||
export const scrollTo = (to: number, duration: number, callback?: Function) => {
|
||||
export const scrollTo = (to: number, duration: number, callback?: any) => {
|
||||
const start = position()
|
||||
const change = to - start
|
||||
const increment = 20
|
||||
|
||||
@@ -8,7 +8,7 @@ export const localStorage = {
|
||||
},
|
||||
// 获取永久缓存
|
||||
get(key: string) {
|
||||
let json: any = window.localStorage.getItem(key);
|
||||
const json: any = window.localStorage.getItem(key);
|
||||
return JSON.parse(json);
|
||||
},
|
||||
// 移除永久缓存
|
||||
@@ -31,7 +31,7 @@ export const sessionStorage = {
|
||||
},
|
||||
// 获取临时缓存
|
||||
get(key: string) {
|
||||
let json: any = window.sessionStorage.getItem(key);
|
||||
const json: any = window.sessionStorage.getItem(key);
|
||||
return JSON.parse(json);
|
||||
},
|
||||
// 移除临时缓存
|
||||
|
||||
Reference in New Issue
Block a user