diff --git a/api/login.js b/api/login.js
index 1cdb90e..e61d732 100644
--- a/api/login.js
+++ b/api/login.js
@@ -79,13 +79,13 @@ export function loginAppuserName(data) {
})
}
-// 使用租户域名(标识),获得租户编号
-export function getTenantIdByWebsite(website) {
+// 使用手机号查询所在的租户获得租户编号
+export function getTenantIdByPhone(phone) {
return request({
- url: '/admin-api/system/tenant/getListByWebsite',
+ url: '/app-api/system/user/getListByPhone',
method: 'get',
params: {
- website
+ phone
}
})
}
diff --git a/components/tabBar/tabBar.vue b/components/tabBar/tabBar.vue
index b7cb840..d5ef467 100644
--- a/components/tabBar/tabBar.vue
+++ b/components/tabBar/tabBar.vue
@@ -14,13 +14,13 @@
工单处理
-
-
-
-
-
- 我的
-
+
+
+
+
+
+
+
diff --git a/config.js b/config.js
index 8280d52..d3ad51e 100644
--- a/config.js
+++ b/config.js
@@ -1,7 +1,7 @@
// 应用全局配置
module.exports = {
- baseUrl: 'https://www.nuoyunr.com',
- // baseUrl: 'http://192.168.1.4:48080',
+ // baseUrl: 'https://www.nuoyunr.com',
+ baseUrl: 'http://192.168.1.17:48080',
// baseUrl: "http://localhost:48080",
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
baseImageUrl: 'https://www.nuoyunr.com/minio/',
diff --git a/pages-home/home/home.vue b/pages-home/home/home.vue
index 0123320..0dd985c 100644
--- a/pages-home/home/home.vue
+++ b/pages-home/home/home.vue
@@ -3,13 +3,14 @@
-
-
+
+
+
- {{ userInfo.userName }}
- {{ userInfo.userType }}
+ {{ userInfo.nickname }}
+
-
+
@@ -43,6 +44,11 @@
import tabBarVue from '@/components/tabBar/tabBar.vue'
import VNavigationBar from '@/components/VNavigationBar.vue'
import OrderCard from "@/components/orderCard.vue";
+import config from '@/config'
+import {
+ getToken,
+ getUserInfo
+} from '@/utils/auth'
export default {
components: {
@@ -52,10 +58,10 @@ export default {
},
data() {
return {
+ imgUrlPrex:config.baseImageUrl,
userInfo: {
- avatarUrl: undefined,
- userName: '曾廷',
- userType: '服务顾问'
+ avatar: undefined,
+ nickname: '曾廷'
},
menuList: [
{
@@ -103,7 +109,15 @@ export default {
defaultAvatar: require('@/static/icons/avatar.png')
}
},
- onShow() {
+ onLoad() {
+ if(!getToken()){
+ uni.reLaunch({
+ url: '/pages/login/login'
+ })
+ }else{
+ //直接取缓存中的用户信息
+ this.userInfo = getUserInfo()
+ }
},
methods: {
gotoPage(menu) {
@@ -113,7 +127,7 @@ export default {
},
avatarErr(err) {
console.log('err', err)
- this.userInfo.avatarUrl = this.defaultAvatar
+ this.userInfo.avatar = this.defaultAvatar
},
showUserDetail() {
uni.navigateTo({
diff --git a/pages-home/static/yaoqingma.png b/pages-home/static/yaoqingma.png
new file mode 100644
index 0000000..fa0d844
Binary files /dev/null and b/pages-home/static/yaoqingma.png differ
diff --git a/pages/index/index.vue b/pages/index/index.vue
index e07137e..f4d597c 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -17,7 +17,7 @@
},
onLoad() {
uni.reLaunch({
- url: '/pages-home/home/home'
+ url: '/pages/login/login'
})
},
methods: {
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 68be44b..eda685a 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -1,241 +1,203 @@
-
-
- 您好,
- 欢迎登录智修小助手
-
-
-
-
-
-
-
-
-
-
+
+
+
+
- 请您认真阅读
- 《用户协议》
+
+ {{item.text}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 忘记密码
+
+
+
+ 登 录
+
+
+
+
+
+ 请仔细阅读
+ 《用户协议》
和
- 《隐私政策》
+ 《隐私政策》
diff --git a/pages/my/myInfo.vue b/pages/my/myInfo.vue
index f2d532a..fb1d675 100644
--- a/pages/my/myInfo.vue
+++ b/pages/my/myInfo.vue
@@ -17,12 +17,20 @@
{{ customInfo.name }}
-
+
绑定电话
{{ customInfo.phone }}
+
+
+ 我的邀请码
+
+
+
+
+
退出登录
diff --git a/utils/auth.js b/utils/auth.js
index 0a35c4a..cf0b821 100644
--- a/utils/auth.js
+++ b/utils/auth.js
@@ -32,9 +32,13 @@ export function hasRole(roleCode) {
}
export function getUserInfo() {
- return uni.getStorageSync(UserInfo)
+ if(uni.getStorageSync(UserInfo)){
+ return JSON.parse(uni.getStorageSync(UserInfo))
+ }else{
+ return undefined;
+ }
}
-export function setUserInfo(userInfo) {
- return uni.setStorageSync(UserInfo, userInfo)
+export function setUserInfo(dataObj) {
+ return uni.setStorageSync(UserInfo, JSON.stringify(dataObj))
}