去除生产环境打印
This commit is contained in:
16
App.vue
16
App.vue
@@ -1,19 +1,23 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
// 生产环境禁用所有 console 方法
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
const noop = () => {};
|
||||
console.log = noop;
|
||||
console.info = noop;
|
||||
console.warn = noop;
|
||||
console.error = noop;
|
||||
}
|
||||
console.log('App Launch ');
|
||||
console.log('App Launch test');
|
||||
uni.setStorageSync('adRewardedNum',0)
|
||||
uni.setStorageSync('adRewardedNum', 0)
|
||||
|
||||
},
|
||||
onShow: function() {
|
||||
},
|
||||
onShow: function() {},
|
||||
onHide: function() {
|
||||
console.log('App Hide');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user