Browse Source

inituser

release_0.0.3
巴林闲侠 2 years ago
parent
commit
16bf3282b2
  1. 4
      code/api/app/lib/controllers/user.js
  2. 1
      code/web/client/src/sections/auth/containers/cross.jsx

4
code/api/app/lib/controllers/user.js

@ -30,7 +30,9 @@ async function accord (ctx) {
const { action, data: params } = data
if (action == 'create') {
await models.User.create(params)
let params_ = JSON.parse(JSON.stringify(params))
params_.delete = false
await models.User.create(params_)
} else {
await models.User.update(params, {
where: {

1
code/web/client/src/sections/auth/containers/cross.jsx

@ -39,7 +39,6 @@ const Cross = ({ dispatch, actions }) => {
if (user) {
user = JSON.parse(user)
const crossRslt = await dispatch(authAction.crossCheck({ token: user.token }))
window.parent.postMessage({ action: 'initUser', user: user }, '*');
if (crossRslt.success && crossRslt.payload.data.cross) {
window.parent.postMessage({ action: 'initUser', user: user }, '*');
} else {

Loading…
Cancel
Save