Skip to content

Commit

Permalink
feat: update management system address
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfulyang committed Nov 2, 2023
1 parent e21635d commit 0514f0e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/components/NavBar/User/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { loginUrl } from '@/constant/Constant';
import React, { useMemo } from 'react';
import classNames from 'classnames';
import { LazyImage } from '@/components/LazyImage';
Expand All @@ -7,7 +8,7 @@ import styles from './index.module.scss';
export const login = () => {
const { href } = window.location;
// 前往中央登录中心
window.location.href = `https://powerfulyang.com/admin/user/login?redirect=${encodeURI(href)}`;
window.location.href = `${loginUrl}?redirect=${encodeURI(href)}`;
};

export const NavBarUser = () => {
Expand Down
3 changes: 3 additions & 0 deletions src/constant/Constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ export const MarkdownImageFromAssetManageAltConstant = 'source protected';
export const CDN_ORIGIN = JSON.parse(variables.CDN_ORIGIN) as string;

export const generateCdnStaticUrl = (path: string) => `${CDN_ORIGIN}${path}`;

export const management = 'https://admin.powerfulyang.com';
export const loginUrl = `${management}/user/login`;
1 change: 1 addition & 0 deletions src/hooks/useUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const useUser = (enabled: boolean = false) => {
const u = await clientApi.queryCurrentUser();
return u.data;
},
keepPreviousData: true,
retry: false,
refetchOnWindowFocus: true,
enabled,
Expand Down
4 changes: 3 additions & 1 deletion src/pages/tools/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { management } from '@/constant/Constant';
import Link from 'next/link';
import type { HTMLAttributeAnchorTarget } from 'react';
import { Card, CardContent } from '@/components/ui/card';
Expand Down Expand Up @@ -80,7 +81,8 @@ const tools: ToolProps[] = [
name: 'Management',
description: 'Management',
icon: 'https://scrnli.com/static/media/convert.72f8549077f576625a23b196db551253.svg',
url: '/admin/user/list',
url: management,
target: '_blank',
},
{
name: 'URL Params Extractor',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/tools/swagger2code/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type FormHookData = {

const Swagger2code: LayoutFC = () => {
const [search, setSearch] = useState('');
const [url, setUrl] = useState('https://powerfulyang.com/api/swagger-json');
const [url, setUrl] = useState('https://api.powerfulyang.com/api/swagger-json');
const { control, handleSubmit } = useForm<FormHookData>({
defaultValues: {
path: null,
Expand Down Expand Up @@ -85,7 +85,7 @@ const Swagger2code: LayoutFC = () => {
<div className="flex w-full items-center justify-center gap-2">
<Input
disabled={loadSwagger.isSuccess}
placeholder="Enter Swagger Url, e.g. https://powerfulyang.com/api/swagger.json"
placeholder="Enter Swagger Url, e.g. https://api.powerfulyang.com/api/swagger.json"
value={url}
onChange={(e) => {
setUrl(e.target.value);
Expand Down

1 comment on commit 0514f0e

@vercel
Copy link

@vercel vercel bot commented on 0514f0e Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

powerfulyang-com – ./

powerfulyang.com
powerfulyang-com-powerfulyang.vercel.app
powerfulyang-com-git-master-powerfulyang.vercel.app

Please sign in to comment.