Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/refactor-get-version' into refac…
Browse files Browse the repository at this point in the history
…tor-get-version
  • Loading branch information
Zzm0809 committed Nov 4, 2024
2 parents 4d45f97 + 1c03f6f commit cbd6616
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ public Result<SaTokenInfo> getTokenInfo() {
@ApiOperation(value = "Query Service Version", notes = "Query Dinky Service Version Number")
@ApiImplicitParam(name = "isExternalCall", value = "isExternalCall", dataTypeClass = Boolean.class)
@SaCheckLogin
public Result<Object> getVersionInfo(@RequestParam(required = false,defaultValue = "true") boolean isExternalCall) {
public Result<Object> getVersionInfo(
@RequestParam(required = false, defaultValue = "true") boolean isExternalCall) {
if (isExternalCall) {
return Result.succeed((Object) DinkyVersion.getShortVersion());
}
Expand Down
18 changes: 10 additions & 8 deletions dinky-web/src/pages/Other/Login/function.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ export const redirectToLogin = (tipMsg: string) => {
export const initSomeThing = () => {
// initialize setting theme
setLocalThemeToStorage();
queryDataByParams<string>(API_CONSTANTS.GET_SERVICE_VERSION, {isExternalCall: false}).then((result) => {
if (result && result != getValueFromLocalStorage(SERVER_VERSION)) {
console.log('current version:', getValueFromLocalStorage(SERVER_VERSION));
console.log('update server version:', result);
setKeyToLocalStorage(SERVER_VERSION, result);
console.log('clean dva cache');
window.localStorage.removeItem('persist:root');
queryDataByParams<string>(API_CONSTANTS.GET_SERVICE_VERSION, { isExternalCall: false }).then(
(result) => {
if (result && result != getValueFromLocalStorage(SERVER_VERSION)) {
console.log('current version:', getValueFromLocalStorage(SERVER_VERSION));
console.log('update server version:', result);
setKeyToLocalStorage(SERVER_VERSION, result);
console.log('clean dva cache');
window.localStorage.removeItem('persist:root');
}
}
});
);

// Retrieve the key for enabling message prompts from the local storage, and if not, set it accordingly
if (hasKeyofLocalStorage(ENABLE_MODEL_TIP)) {
Expand Down

0 comments on commit cbd6616

Please sign in to comment.