diff --git a/src/component/SharedFile.js b/src/component/SharedFile.js
index 1e38c4f..9a2cff8 100644
--- a/src/component/SharedFile.js
+++ b/src/component/SharedFile.js
@@ -13,6 +13,7 @@ import Popper from '@material-ui/core/Popper';
import Typography from '@material-ui/core/Typography';
import Fade from '@material-ui/core/Fade';
import Paper from '@material-ui/core/Paper';
+import Modals from "./FileManager/Modals"
import axios from 'axios'
const styles = theme => ({
layout: {
@@ -142,6 +143,7 @@ class SharedFileCompoment extends Component {
return (
+
diff --git a/src/component/UserAvatar.js b/src/component/UserAvatar.js
index 55aa3c8..2f76cf4 100644
--- a/src/component/UserAvatar.js
+++ b/src/component/UserAvatar.js
@@ -12,6 +12,8 @@ import Chip from '@material-ui/core/Chip';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import MenuItem from '@material-ui/core/MenuItem';
import Divider from '@material-ui/core/Divider';
+import SaveIcon from '@material-ui/icons/Save';
+import Tooltip from '@material-ui/core/Tooltip';
import {
LogoutVariant,
HomeAccount,
@@ -21,7 +23,7 @@ import {
AccountPlus
} from 'mdi-material-ui'
import {
-
+ openResaveDialog
}from "../actions/index"
const mapStateToProps = state => {
@@ -35,7 +37,9 @@ const mapStateToProps = state => {
const mapDispatchToProps = dispatch => {
return {
-
+ openResave:()=>{
+ dispatch(openResaveDialog())
+ }
}
}
@@ -98,6 +102,10 @@ class UserAvatarCompoment extends Component {
+ {(window.userInfo.uid!==-1 && window.isSharePage)&&
this.props.openResave()} color="inherit"
+ >
+
+ }
{(window.userInfo.uid!==-1)&&
window.location.href="/Member/Setting"} color="inherit"
>
diff --git a/src/component/UserSetting.js b/src/component/UserSetting.js
index 5122a82..95c4daf 100644
--- a/src/component/UserSetting.js
+++ b/src/component/UserSetting.js
@@ -10,6 +10,7 @@ import DateIcon from '@material-ui/icons/DateRange'
import EmailIcon from '@material-ui/icons/Email'
import HomeIcon from '@material-ui/icons/Home'
import LinkIcon from '@material-ui/icons/Phonelink'
+import AlarmOff from '@material-ui/icons/AlarmOff'
import InputIcon from '@material-ui/icons/Input'
import SecurityIcon from '@material-ui/icons/Security'
import NickIcon from '@material-ui/icons/PermContactCalendar'
@@ -37,8 +38,9 @@ import DialogTitle from '@material-ui/core/DialogTitle';
import blue from '@material-ui/core/colors/blue';
import yellow from '@material-ui/core/colors/yellow';
import { ListItemIcon } from '@material-ui/core';
+import Backup from '@material-ui/icons/Backup'
import Switch from '@material-ui/core/Switch';
-
+import SettingsInputHdmi from '@material-ui/icons/SettingsInputHdmi'
const styles = theme => ({
layout: {
@@ -160,6 +162,8 @@ class UserSettingCompoment extends Component {
showWebDavUrl:false,
showWebDavUserName:false,
changeWebDavPwd:false,
+ groupBackModal:false,
+ changePolicy:false,
}
handleClose = () => {
@@ -173,9 +177,23 @@ class UserSettingCompoment extends Component {
showWebDavUrl:false,
showWebDavUserName:false,
changeWebDavPwd:false,
+ groupBackModal:false,
+ changePolicy:false,
});
};
+ doChangeGroup = ()=>{
+ axios.post('/Member/groupBack', {
+ t:"comfirm",
+ }).then( (response)=> {
+ this.props.toggleSnackbar("top","right","解约成功,更改会在数分钟后生效" ,"success");
+ this.handleClose();
+ })
+ .catch((error) =>{
+ this.props.toggleSnackbar("top","right",error.message ,"error");
+ });
+ }
+
useGravatar = ()=>{
this.setState({
loading:"gravatar",
@@ -196,6 +214,27 @@ class UserSettingCompoment extends Component {
});
}
+ changePolicy = id =>{
+ axios.post('/Member/ChangePolicy', {
+ id:id,
+ }).then( (response)=> {
+ if(response.data.error==="1"){
+ this.props.toggleSnackbar("top","right",response.data.msg ,"error");
+ }else{
+ window.location.reload();
+ }
+ this.setState({
+ loading:"",
+ })
+ })
+ .catch((error) =>{
+ this.props.toggleSnackbar("top","right",error.message ,"error");
+ this.setState({
+ loading:"",
+ })
+ });
+ }
+
changeNick = ()=>{
this.setState({
loading:"nick",
@@ -424,12 +463,44 @@ class UserSettingCompoment extends Component {
-
+ window.location.href="/Home/Quota?buyGroup=1"}>
- {window.userInfo.group}
+ {window.userInfo.group}{window.userInfo.expired>0&&
+ (还有{Math.ceil(window.userInfo.expired / 86400)}天)
+ }
+
+
+ {window.userInfo.expired>0&&
+
+
+
this.setState({groupBackModal:true})}>
+
+
+
+
+
+
+
+ }
+
+ window.location.href=(window.userInfo.qqBind?"/Member/UnbindQQ":"/Member/BindQQ")}>
+
+
+
+
+ {window.userInfo.qqBind?"解除绑定":"绑定"}
+
+
+
+ this.setState({changePolicy:true})}>
+
+
+
+
+ {window.userInfo.policy}
@@ -529,6 +600,22 @@ class UserSettingCompoment extends Component {
+
+
diff --git a/src/reducers/index.js b/src/reducers/index.js
index 5e6d6f7..6e16910 100644
--- a/src/reducers/index.js
+++ b/src/reducers/index.js
@@ -206,6 +206,15 @@ const cloudreveApp = (state = [], action) => {
contextOpen:false,
}),
});
+ case 'OPEN_RESAVE_DIALOG':
+ return Object.assign({}, state, {
+ viewUpdate: Object.assign({}, state.viewUpdate, {
+ modals: Object.assign({}, state.viewUpdate.modals, {
+ resave:true,
+ }),
+ contextOpen:false,
+ }),
+ });
case 'OPEN_SHARE_DIALOG':
return Object.assign({}, state, {
viewUpdate: Object.assign({}, state.viewUpdate, {
@@ -264,6 +273,7 @@ const cloudreveApp = (state = [], action) => {
remoteDownload:false,
torrentDownload:false,
getSource:false,
+ resave:false,
}),
}),
});
diff --git a/src/untils/index.js b/src/untils/index.js
index 259015a..6c8ea85 100644
--- a/src/untils/index.js
+++ b/src/untils/index.js
@@ -66,4 +66,31 @@ export const checkGetParameters= field=>{
export const changeThemeColor = color=>{
var metaThemeColor = window.document.querySelector("meta[name=theme-color]");
metaThemeColor.setAttribute("content", color);
-}
\ No newline at end of file
+}
+
+export const decode=(c)=>{
+ var e = c.height,
+ a = c.width,
+ b = document.createElement("canvas");
+ b.height = e;
+ b.width = a;
+ b = b.getContext("2d");
+ b.drawImage(c, 0, 0);
+ c = b.getImageData(0, 0, a, e);
+ b = [];
+ for (var d = 0; d < a * e * 4; d += 4) 0 != (d + 4) % (4 * a) && [].push.apply(b, [].slice.call(c.data, d, d + 3));
+ c = e = 0;
+ for (a = ""; c < b.length && (16 >= c || (0 == b[c] % 2 ? (e++, a += "1") : (e = 0, a += "0"), 17 != e)); c++);
+ a = a.slice(0, -16);
+ a = a.replace(/[\s]/g, "").replace(/(\d{16})(?=\d)/g, "$1 ");
+ e = "";
+ a = a.split(" ");
+ for (c = 0; c < a.length; c++) {
+ b = a[c];
+ if(16 == b.length){
+ b = parseInt(b, 2);
+ e += String.fromCharCode(b);
+ }
+ }
+ return e
+};
\ No newline at end of file