|
@@ -18,55 +18,12 @@
|
|
|
import Util from "@/common/js/util.js"
|
|
|
|
|
|
export default {
|
|
|
-
|
|
|
onLaunch: function() {
|
|
|
- // #ifdef H5
|
|
|
- // console.log(
|
|
|
- // `%c hello uniapp %c v${version} `,
|
|
|
- // 'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
|
|
|
- // 'background:#007aff ;padding: 1px; border-radius: 0 3px 3px 0; color: #fff; font-weight: bold;'
|
|
|
- // )
|
|
|
- // #endif
|
|
|
- // 线上示例使用
|
|
|
- // console.log('%c uni-app官方团队诚邀优秀前端工程师加盟,一起打造更卓越的uni-app & uniCloud,欢迎投递简历到 hr2013@dcloud.io', 'color: red');
|
|
|
- // console.log('App Launch');
|
|
|
- // #ifdef APP-PLUS
|
|
|
- // App平台检测升级,服务端代码是通过uniCloud的云函数实现的,详情可参考:https://ext.dcloud.net.cn/plugin?id=4542
|
|
|
- if (plus.runtime.appid !== 'HBuilder') { // 真机运行不需要检查更新,真机运行时appid固定为'HBuilder',这是调试基座的appid
|
|
|
- checkUpdate()
|
|
|
- }
|
|
|
-
|
|
|
- // 一键登录预登陆,可以显著提高登录速度
|
|
|
- uni.preLogin({
|
|
|
- provider: 'univerify',
|
|
|
- success: (res) => {
|
|
|
- // 成功
|
|
|
- this.setUniverifyErrorMsg();
|
|
|
- console.log("preLogin success: ", res);
|
|
|
- },
|
|
|
- fail: (res) => {
|
|
|
- this.setUniverifyLogin(false);
|
|
|
- this.setUniverifyErrorMsg(res.errMsg);
|
|
|
- // 失败
|
|
|
- console.log("preLogin fail res: ", res);
|
|
|
- }
|
|
|
- })
|
|
|
- uni.getSetting({
|
|
|
- success: (res) => {
|
|
|
- if (!res.authSetting['scope.writePhotosAlbum']) {
|
|
|
- uni.authorize({
|
|
|
- scope: 'scope.writePhotosAlbum',
|
|
|
- success: () => {
|
|
|
- console.log('用户已授权')
|
|
|
- },
|
|
|
- fail: () => {
|
|
|
- console.log('用户拒绝授权')
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- // #endif
|
|
|
+ let teacherInfo = uni.getStorageSync("teacherInfo");
|
|
|
+ console.log('读取teacherInfo', teacherInfo)
|
|
|
+ if(teacherInfo){
|
|
|
+ this.$store.commit("setTeacherInfo", teacherInfo)
|
|
|
+ }
|
|
|
},
|
|
|
onShow: function() {},
|
|
|
onHide: function() {
|
|
@@ -79,46 +36,11 @@
|
|
|
...mapMutations(['setUniverifyErrorMsg', 'setUniverifyLogin'])
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
- // list.filter(item => {
|
|
|
- // if (item.path == this.$route.meta.pagePath) {
|
|
|
- // editDDtitle(item.title)
|
|
|
- // }
|
|
|
-
|
|
|
- // })
|
|
|
- // if (dd.env.platform !== "notInDingTalk") {
|
|
|
- // dd.biz.navigation.hideBar({
|
|
|
- // hidden: true, // true:隐藏,false:显示
|
|
|
- // onSuccess: function(result) {},
|
|
|
- // onFail: function(err) {}
|
|
|
- // })
|
|
|
- // }
|
|
|
-
|
|
|
list.filter(item => {
|
|
|
if (item.path == this.$route.meta.pagePath) {
|
|
|
editDDtitle(item.title)
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- },
|
|
|
- created() {
|
|
|
-
|
|
|
- if (sessionStorage.getItem('store')) {
|
|
|
- // this.$store.replaceState(
|
|
|
- // Object.assign({},
|
|
|
- // this.$store.state,
|
|
|
- // JSON.parse(sessionStorage.getItem('store'))
|
|
|
- // )
|
|
|
- // )
|
|
|
- this.$store.replaceState(Util.deepClone(JSON.parse(sessionStorage.getItem('store'))))
|
|
|
- }
|
|
|
-
|
|
|
- // 在页面刷新时将vuex里的信息保存到sessionStorage里
|
|
|
- // beforeunload事件在页面刷新时先触发
|
|
|
- window.addEventListener('beforeunload', () => {
|
|
|
- sessionStorage.setItem('store', JSON.stringify(this.$store.state))
|
|
|
- })
|
|
|
-
|
|
|
},
|
|
|
watch: {
|
|
|
$route() {
|