mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-10 02:23:43 +08:00
feat: berry theme update & bug fix (#1471)
* feat: load channel models from server * chore: support AWS Claude/Cloudflare/Coze * fix: Popup message when copying fails * chore: Optimize tips
This commit is contained in:
@@ -4,7 +4,7 @@ import SubCard from 'ui-component/cards/SubCard';
|
||||
import inviteImage from 'assets/images/invite/cwok_casual_19.webp';
|
||||
import { useState } from 'react';
|
||||
import { API } from 'utils/api';
|
||||
import { showError, showSuccess } from 'utils/common';
|
||||
import { showError, copy } from 'utils/common';
|
||||
|
||||
const InviteCard = () => {
|
||||
const theme = useTheme();
|
||||
@@ -12,8 +12,7 @@ const InviteCard = () => {
|
||||
|
||||
const handleInviteUrl = async () => {
|
||||
if (inviteUl) {
|
||||
navigator.clipboard.writeText(inviteUl);
|
||||
showSuccess(`邀请链接已复制到剪切板`);
|
||||
copy(inviteUl, '邀请链接');
|
||||
return;
|
||||
}
|
||||
const res = await API.get('/api/user/aff');
|
||||
@@ -21,8 +20,7 @@ const InviteCard = () => {
|
||||
if (success) {
|
||||
let link = `${window.location.origin}/register?aff=${data}`;
|
||||
setInviteUrl(link);
|
||||
navigator.clipboard.writeText(link);
|
||||
showSuccess(`邀请链接已复制到剪切板`);
|
||||
copy(link, '邀请链接');
|
||||
} else {
|
||||
showError(message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user