support multiple tenants
parent
44a67f8200
commit
b18e96d1b0
File diff suppressed because it is too large
Load Diff
|
@ -14,6 +14,7 @@
|
|||
"axios": "^0.24.0",
|
||||
"localstorage-slim": "^2.2.0",
|
||||
"qrcode": "^1.5.0",
|
||||
"query-string": "^7.1.1",
|
||||
"react": "^17.0.2",
|
||||
"react-copy-to-clipboard": "^5.0.4",
|
||||
"react-dom": "^17.0.2",
|
||||
|
|
|
@ -80,7 +80,7 @@ class App extends React.Component {
|
|||
loading: true
|
||||
})
|
||||
|
||||
var projectNames = await this.fetchProjects();
|
||||
var projectNames = await this.fetchProjects() || ['无项目'];
|
||||
this.setState({
|
||||
projects: projectNames,
|
||||
selectedProjectName: projectNames[0],
|
||||
|
|
|
@ -9,6 +9,7 @@ var rowTitles = ['开头', '中间', '结尾']
|
|||
function SettingFrame(props) {
|
||||
var [settingArr, setSettingArr] = useState([1, 2, 3])
|
||||
var [openPopup, setOpenPopup] = useState(false);
|
||||
console.log(props.settingValue)
|
||||
useEffect(() => {
|
||||
setSettingArr(props.settingValue)
|
||||
}, [props.settingValue])
|
||||
|
|
|
@ -29,8 +29,8 @@ export async function getProjects() {
|
|||
} else {
|
||||
return client.list({ prefix: prefix, delimiter: '/' })
|
||||
.then(result =>
|
||||
result.prefixes.map(item => item.slice(prefix.length, item.length - 1))
|
||||
)
|
||||
result.prefixes?.map(item => item.slice(prefix.length, item.length - 1)))
|
||||
.catch(() => []);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import packageJson from '../package.json'
|
||||
import queryString from 'query-string'
|
||||
|
||||
export function getTenant() {
|
||||
return packageJson.homepage === "/preview" ? "funplus" : packageJson.homepage.slice(1)
|
||||
const tenant = queryString.parseUrl(window.location.href)?.query?.tenant
|
||||
return tenant || "funplus"
|
||||
}
|
Loading…
Reference in New Issue