Commit 2c6e0dc7 by zhangzhen

细节优化

parent 940066e5
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import { login } from "@/api/index.js";
export default { export default {
onLaunch: function(e) { onLaunch: function(e) {
// 版本更新机制 // 版本更新机制
...@@ -26,6 +27,22 @@ ...@@ -26,6 +27,22 @@
// }) // })
// } // }
wx.login({
success: (res) => {
login(res.code).then(res => {
if (res.data.code == 200) {
if (res.data.data.type === "login") {
uni.setStorageSync('tokenHeaders', "Authori-zation")
uni.setStorage({
key: uni.getStorageSync('tokenHeaders'),
data: res.data.data.token
})
}
}
})
}
})
if(uni.getStorageSync("storeId")){ if(uni.getStorageSync("storeId")){
uni.removeStorageSync("storeId") uni.removeStorageSync("storeId")
} }
......
...@@ -66,8 +66,6 @@ ...@@ -66,8 +66,6 @@
}) })
} }
}) })
}, },
onCancle(){ onCancle(){
this.$refs.popupPhone.close() this.$refs.popupPhone.close()
......
...@@ -403,10 +403,12 @@ ...@@ -403,10 +403,12 @@
}, },
onGetSysConfig() { onGetSysConfig() {
systemConfig().then(res => { systemConfig().then(res => {
uni.setStorage({ if(res.data.code == 200){
key: 'sysConfig', uni.setStorage({
data: res.data.rows key: 'sysConfig',
}) data: res.data.rows
})
}
}) })
}, },
onGetDicts() { onGetDicts() {
......
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