mirror of
https://github.com/eyebluecn/tank-front
synced 2026-10-19 16:16:18 +00:00
fix some safety problem and add copy share feature
This commit is contained in:
+6
-5
@@ -9,20 +9,21 @@ module.exports = {
|
||||
target: 'http://localhost:6010',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/api': '/api'
|
||||
}
|
||||
}
|
||||
'^/api': '/api',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
|
||||
// less loader.
|
||||
plugin: CracoLessPlugin,
|
||||
options: {
|
||||
// resolve-url-loader只对sass生效,craco-less默认使用sass配置,所以这里手动过滤掉resolve-url-loader
|
||||
modifyLessRule: (lessRule) => {
|
||||
lessRule.use = lessRule.use.filter(i => !i.loader.includes('resolve-url-loader'));
|
||||
lessRule.use = lessRule.use.filter(
|
||||
(i) => !i.loader.includes('resolve-url-loader')
|
||||
);
|
||||
return lessRule;
|
||||
},
|
||||
lessLoaderOptions: {
|
||||
|
||||
@@ -59,7 +59,11 @@ export default class Detail extends TankComponent<IProps, IState> {
|
||||
this.share.uuid = this.props.match.params.uuid;
|
||||
this.pager.urlPage = Share.URL_MATTER_PAGE;
|
||||
|
||||
if (this.user.hasLogin()) {
|
||||
if (!!BrowserUtil.getQueryByName('code')) {
|
||||
this.getFiles(BrowserUtil.getQueryByName('code')!);
|
||||
// 去除url中的code query
|
||||
window.history.replaceState({}, '', window.location.pathname);
|
||||
} else if (this.user.hasLogin()) {
|
||||
this.pager.enableHistory();
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import ShareBar from './widget/ShareBar';
|
||||
|
||||
import './List.less';
|
||||
import Lang from '../../common/model/global/Lang';
|
||||
import SortDirection from '../../common/model/base/SortDirection';
|
||||
|
||||
interface IProps extends RouteComponentProps {}
|
||||
|
||||
@@ -23,6 +24,7 @@ export default class List extends TankComponent<IProps, IState> {
|
||||
|
||||
componentDidMount() {
|
||||
this.pager.enableHistory();
|
||||
this.pager.setFilterValue('orderCreateTime', SortDirection.DESC);
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,8 @@ export default class ShareDialogModal extends TankComponent<IProps, IState> {
|
||||
|
||||
copyAll() {
|
||||
const { share } = this.props;
|
||||
const text = `${Lang.t('share.link')}:${share.getLink()} ${Lang.t(
|
||||
'share.code'
|
||||
)}:${share.code}`;
|
||||
this.clipboard(text);
|
||||
const url = `${share.getLink()}?code=${share.code}`;
|
||||
this.clipboard(url);
|
||||
}
|
||||
|
||||
static open = (share: Share) => {
|
||||
|
||||
Reference in New Issue
Block a user