feat: 修改计费模式为tokens

This commit is contained in:
archer
2023-03-25 14:43:32 +08:00
parent 4eaf3a1be0
commit 6bba859060
18 changed files with 97 additions and 38 deletions

View File

@@ -1,4 +1,5 @@
const tokenKey = 'fast-gpt-token';
export const PRICE_SCALE = 100000;
export const setToken = (val: string) => {
localStorage.setItem(tokenKey, val);
@@ -14,5 +15,5 @@ export const clearToken = () => {
* 把数据库读取到的price转化成元
*/
export const formatPrice = (val: number) => {
return val / 100000;
return val / PRICE_SCALE;
};