wangjinbiao пре 5 година
родитељ
комит
89990eb4a6

+ 1 - 1
dorm-manager-wx/pages/login/index.js

@@ -15,7 +15,7 @@ const app = getApp(),
 
 Page({
   data: {
-    tab: ['个人', '法人']
+    tab: ['微信授权登录']
   },
   onLoad() {
     const identity = wx.getStorageSync("identity") | 0

+ 1 - 1
dorm-manager-wx/pages/login/index.wxml

@@ -1,4 +1,4 @@
-<view class='switch'>
+<view class='switch' style="display:none">
   <view wx:for='{{tab}}' bindtap='select' data-identity='{{index}}' class="{{index== identity ?'select':''}}">
     {{item}}
   </view>

+ 7 - 5
dorm-manager-wx/pages/login/login.js

@@ -34,11 +34,13 @@ Page({
       },
       success(res){
         if(res.data.status=='success'){
-          wx.setStorageSync('user', res.data.data)
-          wx.setStorageSync('loginId', e.detail.value.account)
-          wx.switchTab({
-            url: '/pages/student/menu/menu',
-          })
+          if(that.data.index==0){//学生端
+            wx.setStorageSync('user', res.data.data)
+            wx.setStorageSync('loginId', e.detail.value.account)
+            wx.switchTab({
+              url: '/pages/student/menu/menu',
+            })
+          }
         }else{
           wx.showToast({
             title: res.data.message,

+ 5 - 5
dorm-manager-wx/pages/user/index.js

@@ -75,11 +75,11 @@ Page({
         //   icon: 'tousu',
         //   url: 'complaint/complaint',
         // },
-        // {
-        //   title: '我的设置',
-        //   icon: 'shezhi',
-        //   url: 'setting/index',
-        // }
+        {
+          title: '我的设置',
+          icon: 'setting',
+          url: 'setting/index',
+        }
       ]
 
     })

+ 1 - 1
dorm-manager-wx/pages/user/index.wxml

@@ -24,4 +24,4 @@
       <image src='/images/jiantou.png'></image>
     </view>
   </view>
-</block>
+</block>

+ 6 - 4
dorm-manager-wx/pages/user/setting/index.js

@@ -23,10 +23,12 @@ Page({
     wx.showModal({
       content: '确定退出登录?',
       success: async ({ confirm }) => {
-        if (!confirm) return
-        logout()
-        await goHome()
-        showTip('已退出')
+        if (confirm){
+          wx.clearStorageSync()
+          wx.reLaunch({
+            url: '/pages/login/login',
+          })
+        }
       }
 
     })

+ 2 - 2
dorm-manager-wx/utils/api.js

@@ -1,5 +1,5 @@
 //index 0开发环境   1测试环境   2正式环境
-const index = 0,
+const index = 2,
   api = {
     login: 'auth/login_by_weixin', //登录
     getMyPrivateMsgCount: 'message/getMyPrivateMsgCount', //加载是否有未读消息
@@ -96,7 +96,7 @@ const index = 0,
   [oneportal, root] =
     [["http://192.168.100.234:8080/oneportal/", "https://zhll.dgtis.com/wx/"],
       ["http://192.168.100.254:9082/wx/", "https://zhll.dgtis.com/wx/"],
-      ["https://zhll.dgtis.com/wx/", "https://zhll.dgtis.com/wx/"]][index]
+      ["https://dorm.dgtis.com/oneportal/", "https://zhll.dgtis.com/wx/"]][index]
 Object.keys(api).forEach(x => {
   let v = api[x]
   api[x] = `${/\.if$/.test(v) ? oneportal : root}${v}`