mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 20:50:19 +08:00
feat: add local file system storage provider (#224)
Signed-off-by: sh1luo <690898835@qq.com>
This commit is contained in:
@ -148,7 +148,8 @@ class ProviderEditPage extends React.Component {
|
||||
} else if (value === "SMS") {
|
||||
this.updateProviderField('type', 'Aliyun SMS');
|
||||
} else if (value === "Storage") {
|
||||
this.updateProviderField('type', 'Aliyun OSS');
|
||||
this.updateProviderField('type', 'Local File System');
|
||||
this.updateProviderField('domain', Setting.getFullServerUrl());
|
||||
}
|
||||
})}>
|
||||
{
|
||||
@ -167,7 +168,12 @@ class ProviderEditPage extends React.Component {
|
||||
{Setting.getLabel(i18next.t("provider:Type"), i18next.t("provider:Type - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} style={{width: '100%'}} value={this.state.provider.type} onChange={(value => {this.updateProviderField('type', value);})}>
|
||||
<Select virtual={false} style={{width: '100%'}} value={this.state.provider.type} onChange={(value => {
|
||||
this.updateProviderField('type', value);
|
||||
if (value === "Local File System") {
|
||||
this.updateProviderField('domain', Setting.getFullServerUrl());
|
||||
}
|
||||
})}>
|
||||
{
|
||||
this.getProviderTypeOptions(this.state.provider).map((providerType, index) => <Option key={index} value={providerType.id}>{providerType.name}</Option>)
|
||||
}
|
||||
|
@ -48,6 +48,14 @@ function isLocalhost() {
|
||||
return hostname === "localhost";
|
||||
}
|
||||
|
||||
export function getFullServerUrl() {
|
||||
let fullServerUrl = window.location.origin;
|
||||
if (fullServerUrl === "http://localhost:7001") {
|
||||
fullServerUrl = "http://localhost:8000";
|
||||
}
|
||||
return fullServerUrl;
|
||||
}
|
||||
|
||||
export function isProviderVisible(providerItem) {
|
||||
if (providerItem.provider === undefined || providerItem.provider === null) {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user