diff --git a/package.json b/package.json index 7dd1edf..8c845b2 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "typescript": "~3.7.2" }, "scripts": { - "start": "react-scripts start", + "start": "set PORT=3001&&react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" diff --git a/src/Main.tsx b/src/Main.tsx index 2d4145e..f6cf91c 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -10,6 +10,7 @@ import {MyMessage} from "./my/MyMessage"; import {User, UserType} from "./entity"; import {Cookies} from "react-cookie"; import {time_score, user_cookie, user_type_cookie, welcome_cookie} from "./account/PropCookie"; +import {backEnd} from "./api"; /** * 菜单标记 @@ -190,6 +191,7 @@ export class Main extends React.Component< 时间币:{this.state.timeScore} {[DialogType.friend,DialogType.leaveWord,DialogType.message].map((type:DialogType,index:number)=>this.openDialog(type)}>{type})} this.props.logout()}>注销登录 + window.location.href=backEnd}>切换后台 diff --git a/src/account/Register.tsx b/src/account/Register.tsx index 2b11cc7..33503c6 100644 --- a/src/account/Register.tsx +++ b/src/account/Register.tsx @@ -162,9 +162,9 @@ export class Register extends React.Component{ this.setState({imgFile:imgObj}) }} tip={"请上传头像"} /> - this.setState({address:value})}/> + this.setState({address:value})} valid={{check:this.state.address.length>0}}/>
-
this.setState({serviceAddress:value})}/> +
this.setState({serviceAddress:value})}/>
this.setState({userType:value})} options={[,,]}/> diff --git a/src/api.ts b/src/api.ts index 6511c9b..7921cc3 100644 --- a/src/api.ts +++ b/src/api.ts @@ -6,6 +6,8 @@ export const prefix = { activity: "/api/activity", image: "/image/" } +//管理后台地址 +export const backEnd="http://localhost:3000" //接口地址 export const Api = { account: { diff --git a/src/my/MyLeaveWord.tsx b/src/my/MyLeaveWord.tsx index 3aa75ed..5fe9d33 100644 --- a/src/my/MyLeaveWord.tsx +++ b/src/my/MyLeaveWord.tsx @@ -169,7 +169,7 @@ export class MyLeaveWord extends React.Component< } return ( - +

{this.getType(data.type)}

diff --git a/src/sub/Volunteer.tsx b/src/sub/Volunteer.tsx index 01cf8b3..c9b6055 100644 --- a/src/sub/Volunteer.tsx +++ b/src/sub/Volunteer.tsx @@ -96,13 +96,13 @@ export class Volunteer extends React.Component<{ undefined?:undefined }, })}/> - + {/*this.loadVolunteerList(page)} currentPage={this.state.page.currentPage} totalPage={this.state.page.totalPage} pageSize={this.state.page.pageSize}/>*/} {this.state.volunteerList?this.state.volunteerList.length===0?

当前没有志愿者

:this.state.volunteerList.map((volunteers:Array, index:number)=> -
{volunteers.map((volunteer:User, subIndex:number)=> +
{volunteers.map((volunteer:User, subIndex:number)=>
志愿者个人简介 diff --git a/src/ui/Address.tsx b/src/ui/Address.tsx index af3dfc2..d7c8bd9 100644 --- a/src/ui/Address.tsx +++ b/src/ui/Address.tsx @@ -5,7 +5,7 @@ import React from "react"; /** * 加载服务地点信息 */ -export class Address extends React.Component }>{ +export class Address extends React.Component }>{ constructor(props: Readonly) {