Files
FastGPT/src/utils/user.ts
2023-05-08 09:49:11 +08:00

14 lines
380 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { PRICE_SCALE } from '@/constants/common';
const tokenKey = 'fast-gpt-token';
export const clearToken = () => {
document.cookie = 'token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
};
/**
* 把数据库读取到的price转化成元
*/
export const formatPrice = (val = 0, multiple = 1) => {
return Number(((val / PRICE_SCALE) * multiple).toFixed(10));
};