@zscreate/zhxy-app-component 1.0.343 → 1.0.344

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2163,8 +2163,14 @@ export default {
2163
2163
  let departId = -1
2164
2164
  let departName = ""
2165
2165
  if (this.widget.options.departRelation) {
2166
- const userInfo = uni.getStorageSync('userinfo')
2167
- console.log("userInfo: ", userInfo)
2166
+ let userInfo = uni.getStorageSync('userinfo')
2167
+ if (typeof userinfo === 'string') {
2168
+ try {
2169
+ userinfo = JSON.parse(userinfo);
2170
+ } catch (e) {
2171
+ userinfo = {};
2172
+ }
2173
+ }
2168
2174
  departId = this.widget.options.departId || userInfo.departId || userInfo.depart_id
2169
2175
  departName = this.widget.options.departName || userInfo.departName || userInfo.depart_name
2170
2176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zscreate/zhxy-app-component",
3
- "version": "1.0.343",
3
+ "version": "1.0.344",
4
4
  "private": false,
5
5
  "description": "zhxy-app-component",
6
6
  "main": "index.js",