|
|
|
@ -59,16 +59,15 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
|
|
|
|
import { writetoken } from "@/utlis/istoken"; |
|
|
|
import { deepCopy } from "@/utlis/proFunc"; |
|
|
|
import axios from "axios"; |
|
|
|
import { Loading } from "element-ui"; |
|
|
|
import { mapState,mapMutations } from "vuex"; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
sysConfig: {}, // 配置信息 |
|
|
|
form: { |
|
|
|
Username: "", |
|
|
|
Password: "", |
|
|
|
@ -91,7 +90,15 @@ export default { |
|
|
|
LocalConfigInit: {} |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
created() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async mounted() { |
|
|
|
|
|
|
|
this.LocalConfigInit = deepCopy(this.LocalConfig) |
|
|
|
let LocalConfig = window.localStorage.getItem("LocalConfig") || null |
|
|
|
try { |
|
|
|
@ -99,8 +106,7 @@ export default { |
|
|
|
} catch (error) { |
|
|
|
console.log('window.localStorage.getItem("LocalConfig")', error) |
|
|
|
} |
|
|
|
}, |
|
|
|
async mounted() { |
|
|
|
|
|
|
|
if (this.$peisAPI) { |
|
|
|
this.$peisAPI.lazyLoadMenuContrl() |
|
|
|
.then(res => { |
|
|
|
@ -112,15 +118,25 @@ export default { |
|
|
|
} else { |
|
|
|
console.log('this.$peisAPI undefind') |
|
|
|
} |
|
|
|
|
|
|
|
// console.log("this.sysConfig",this.sysConfig) |
|
|
|
await this.getSysConfig() |
|
|
|
// console.log("this.sysConfig2",this.sysConfig) |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
...mapState(['sysConfig']), |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
...mapMutations(["setData"]), |
|
|
|
async getSysConfig() { |
|
|
|
try { |
|
|
|
let res = await axios.get('/sysConfig.json', { timeout: 50000 }) // , { timeout: 50000 } |
|
|
|
console.log('axios.get /sysConfig.json', res) |
|
|
|
if (!res.data.apiurl) this.$message.error({ showClose: true, message: `获取配置参数错误,请重新刷新本页面!` }) |
|
|
|
this.sysConfig = res.data |
|
|
|
this.setData({ key: "sysConfig", value: res.data }); |
|
|
|
// this.sysConfig = res.data |
|
|
|
window.sessionStorage.setItem('sysConfig', JSON.stringify(res.data)) |
|
|
|
} catch (error) { |
|
|
|
this.$message.error({ showClose: true, message: `获取配置参数错误 ${error}` }) |
|
|
|
@ -178,8 +194,10 @@ export default { |
|
|
|
userName: this.form.Username, |
|
|
|
passWord: this.form.Password, |
|
|
|
}).then(ret => { |
|
|
|
console.log('api/identity/users/login',ret) |
|
|
|
let res = ret.data |
|
|
|
if (res.code != -1) { |
|
|
|
|
|
|
|
if (res.code > -1) { |
|
|
|
|
|
|
|
window.sessionStorage.setItem("peisid", res.data.peisid); //设置当前人员所属体检中心 |
|
|
|
writetoken(res.data.expires_in); |
|
|
|
|