Commit dd717bfa authored by leiqingsong's avatar leiqingsong

用户信息获取时好时坏的bug

parent 6f1eaae3
# 生产环境 部署生产环境放开这个
# VUE_APP_BASE_URL = "http://app.xitiansen.com"
VUE_APP_BASE_URL = "http://app.xitiansen.com"
# 测试环境 部署测试环境放开这个
VUE_APP_BASE_URL = "http://8.131.244.76:81"
\ No newline at end of file
# VUE_APP_BASE_URL = "http://8.131.244.76:81"
\ No newline at end of file
......@@ -36,9 +36,9 @@ export default {
});
},
methods: {
saveUser(data) {
async saveUser(data) {
if (data) {
getUserInfo().then(res => {
await getUserInfo().then(res => {
console.log("存用户信息");
if (res.code == 0) {
localStorage.setItem("user", JSON.stringify(res.data));
......
......@@ -38,7 +38,7 @@ export function uploadImage(params, file) {
*/
export function versionUpdate(params) {
return request({
url: '/account/version',
url: "/account/version",
method: "get",
params
});
......@@ -46,12 +46,11 @@ export function versionUpdate(params) {
/**
* 获取App下载路径
* @returns
* @returns
*/
export function getAppDownUrl() {
return request({
url: '/account/download',
method: 'get'
})
url: "/account/download",
method: "get"
});
}
......@@ -71,7 +71,7 @@
</div>
<div v-if="title == '注册失败'" class="tip">{{ tip }}</div>
<div v-else class="tip">
<a :href="androidUrl">下载安卓版App</a> |
<a :href="androidUrl">下载安卓版App</a> |
<a :href="iosUrl">下载IOS版App</a>
</div>
<van-button @click="show = false">确定</van-button>
......@@ -86,8 +86,8 @@ export default {
name: "Register",
data() {
return {
androidUrl: '',
iosUrl: '',
androidUrl: "",
iosUrl: "",
form: {
userId: "",
sms: "",
......@@ -129,7 +129,7 @@ export default {
}
});
}
})
});
},
onClickHide() {
this.show = false;
......
......@@ -3,7 +3,7 @@
<van-cell-group class="group-1">
<van-cell title="用户名" :value="userName" />
<!--is-link @click="onModefy" -->
<van-cell center title="头像" is-link @click="onModefy">
<van-cell center title="头像">
<img class="avatar-img" :src="imageBaseUrl + avatar" alt="头像" />
</van-cell>
</van-cell-group>
......@@ -90,7 +90,7 @@ export default {
};
},
mounted() {
console.log('读取用户信息');
console.log("读取用户信息");
this.imageBaseUrl = process.env.VUE_APP_BASE_URL;
this.getUser();
this.getAppVersion();
......@@ -105,9 +105,9 @@ export default {
},
updateVersion() {
const params = {
type: this.$bridgeToAppFun.userAgent === 'ios' ? 1 : 2,
type: this.$bridgeToAppFun.userAgent === "ios" ? 1 : 2,
version: this.version.substr(2)
}
};
versionUpdate(params).then(res => {
this.versionShow = true;
if (res.code == 1) {
......
......@@ -4,7 +4,7 @@ const name = "西田森App";
module.exports = {
publicPath: "/front",
// outputDir: "front",
outputDir: "front",
devServer: {
proxy: {
'/shop-mall': {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment