本地化改动

This commit is contained in:
qyzh 2021-12-16 19:43:58 +08:00
parent f05984a7ca
commit 600227600a
6 changed files with 24 additions and 19 deletions

Binary file not shown.

6
package-lock.json generated
View File

@ -2920,9 +2920,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001048",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001048.tgz",
"integrity": "sha512-g1iSHKVxornw0K8LG9LLdf+Fxnv7T1Z+mMsf0/YYLclQX4Cd522Ap0Lrw6NFqHgezit78dtyWxzlV2Xfc7vgRg=="
"version": "1.0.30001274",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001274.tgz",
"integrity": "sha512-+Nkvv0fHyhISkiMIjnyjmf5YJcQ1IQHZN6U9TLUMroWR38FNwpsC51Gb68yueafX1V6ifOisInSgP9WJFS13ew=="
},
"capture-stack-trace": {
"version": "1.0.1",

View File

@ -32,8 +32,9 @@ export function initAxiosInterceptors(props) {
// 判断网络是否连接
initOnlineOfflineListener();
// var proxy = "http://172.27.144.138:3000/"
var proxy = "http://114.212.189.230:3000/"
// var proxy = "https://testforgeplus.trustie.net";
var proxy = "http://localhost:3000"
// var proxy = "http://localhost:3000"
//响应前的设置
axios.interceptors.request.use(

View File

@ -5,6 +5,7 @@ import { numFormat } from 'educoder';
function DetailBanner({ history,list , owner , projectsId , isManager , url , pathname , state , urlFlag , projectDetail , platform ,open_devops }){
const [ menuName , setMenuName ] = useState(undefined);
console.log(list);
useEffect(()=>{
if(list){
// banner
@ -17,6 +18,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
setMenuName(list);
}
},[list]);
console.log(list);
return(
<div className="f-wrap-between mt25">
{
@ -115,7 +117,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
</li>
}
{
item.menu_name === "setting" &&
item.menu_name === "settings" &&
<li className={pathname === "setting" ? "active" : ""}>
<Link to={`/projects/${owner}/${projectsId}/setting`}>
<i className={url && url.indexOf("/setting") > 0 ? "iconfont icon-cangkushezhiicon color-grey-3 mr5 font-14":"iconfont icon-cangkushezhiicon color-grey-6 font-14 mr5"}></i>

View File

@ -74,7 +74,7 @@ class extends Component{
return(
<Form >
<FormItem>
{getFieldDecorator(`description`,{
{getFieldDecorator(`sponsor_description`,{
rules: [],
initialValue: initValue ? initValue : undefined
})(
@ -95,7 +95,7 @@ class Sponsor extends Component {
this.state = {
isSpin: false,
user: undefined,
description: undefined,
sponsor_description: undefined,
sponsors: undefined,
edit: false,
tiers: [],
@ -119,9 +119,10 @@ class Sponsor extends Component {
.get(url)
.then((result) => {
// TODO: 在这里添加了对用户自我介绍的处理,前后端交互实现后需要删掉
// result.data.description = tempDesc;
// result.data.sponsor_description = tempDesc;
this.setState({
user: result.data,
sponsor_description: result.data.sponsor_description,
isSpin: false,
}, () => {this.fetchSponsors()});
// console.log(result.data);
@ -154,6 +155,7 @@ class Sponsor extends Component {
isSpin: false,
});
});
// this.setState({
// sponsors: tempData,
// displayList: tempData,
@ -194,13 +196,13 @@ class Sponsor extends Component {
confirmEdit = () => {
//TODO: 增加和后端交互
let value = this.formRef.getItemsValue().description;
let value = this.formRef.getItemsValue().sponsor_description;
// console.log(value);
let user = this.state.user;
let url = `/users/${user.user_id}/update_description.json`
axios.put(url, {description: value})
let url = `/users/${user.user_id}/update_sponsor_description.json`
axios.put(url, {sponsor_description: value})
.then((result) => {
user.description = value;
user.sponsor_description = value;
this.setState({
user: user,
edit: false
@ -214,7 +216,7 @@ class Sponsor extends Component {
// if (user){
// user.description = value;
// user.sponsor_description = value;
// }
// this.setState({
// user: user,
@ -226,8 +228,8 @@ class Sponsor extends Component {
const user = this.state.user;
return (
<div>
{user && user.description?
(<p>{user.description}</p>):(<p></p>)}
{user && user.sponsor_description?
(<p>{user.sponsor_description}</p>):(<p></p>)}
</div>
);
}
@ -239,7 +241,7 @@ class Sponsor extends Component {
<div>
<i className="iconfont icon-bianji3 font-15" onClick={() => this.editDescription()}></i>
</div>
{user && user.description? (<div>{user.description}</div>):(<div></div>)}
{user && user.sponsor_description? (<div>{user.sponsor_description}</div>):(<div></div>)}
</div>
);
}
@ -249,7 +251,7 @@ class Sponsor extends Component {
return (
<div>
<DescriptionForm
initValue={user && user.description}
initValue={user && user.sponsor_description}
wrappedComponentRef={(form) => this.formRef = form}
/>
<Button onClick={() => this.confirmEdit()}>确认</Button>

View File

@ -114,9 +114,9 @@ class InfosUser extends Component {
newItem =()=> (
<Menu>
<Menu.Item key="created_mirror">
{/* <Menu.Item key="created_mirror">
<Link to={`/projects/mirror/new`}>新建镜像项目</Link>
</Menu.Item>
</Menu.Item> */}
<Menu.Item key="created_deposit">
<Link to={`/projects/deposit/new`}>新建托管项目</Link>
</Menu.Item>