fix: 仪表盘分享公共连接地址为localhost,无法访问

This commit is contained in:
fit2cloud-chenyw 2021-06-25 14:05:36 +08:00
parent 0142ec49e5
commit b717b406b2
2 changed files with 7 additions and 3 deletions

View File

@ -24,8 +24,7 @@ import java.util.Map;
@Service
public class PanelLinkService {
@Value("${public-link-url:http://localhost:9528/link.html?link=}")
private String baseUrl;
private static final String baseUrl = "/link.html?link=";
@Value("${public-link-salt:DataEaseLinkSalt}")
private String salt;

View File

@ -66,6 +66,11 @@ export default {
defaultForm: { enablePwd: false, pwd: null, uri: null }
}
},
computed: {
origin() {
return window.location.origin
}
},
created() {
this.form = this.defaultForm
this.currentGenerate()
@ -76,7 +81,7 @@ export default {
const { valid, enablePwd, pwd, uri } = res.data
this.valid = valid
this.form.enablePwd = enablePwd
this.form.uri = uri
this.form.uri = uri ? (this.origin + uri) : uri
//
pwd && (this.form.pwd = decrypt(pwd))
})