@yongdall/user 0.1.4 → 0.3.0

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.
package/assets/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{Store as e,renderStoreForm as t,single as n}from"@yongdall/web";import r from"@yongdall/web/plugin";var i=Object.defineProperty,a=(e,t)=>{let n={};for(var r in e)i(n,r,{get:e[r],enumerable:!0});return t||i(n,Symbol.toStringTag,{value:`Module`}),n};const o=[/[a-z]/,/[A-Z]/,/[0-9]/,/[~!@#$%^&*()_+{}|<>?,./:";'\\\[\]-]/];function*s(e){e.length<8&&(yield`密码不足 8 位`),o.filter(t=>t.test(e)).length<3&&(yield`密码至少包含小写字母、大写字母、数字、符号中的 3 种`),e.toLowerCase().includes(`admin`)&&(yield`密码不能包含admin`),[...e].find((e,t,n)=>n[t-1]===e&&n[t+1]===e)&&(yield`密码不能包含三位以上的相同的字母或数字`),[...e].find((e,t,n)=>{let r=n[t-1],i=n[t+1];if(!r||!i)return!1;let a=r.charCodeAt(0),o=e.charCodeAt(0),s=i.charCodeAt(0),c=a-o,l=o-s;if(c===l&&(l===1||l===-1))return!0})&&(yield`密码不能包含三位以上的连续的字母或数字`)}var c=a({user:()=>d});const l={password:{type:`string`,label:`您的密码`,component:`password`,hidden:n,validators:{blur(e){if(n)return;let t=e.value;if(!t||typeof t!=`string`)return`请填写您的密码`}}},newPassword1:{type:`string`,label:`新密码`,component:`password`,validators:{blur(e){let t=e.value;return!t||typeof t!=`string`?`请填写新密码`:[...s(t)]}}},newPassword2:{type:`string`,label:`重复密码`,component:`password`,validators:{blur(e){let t=e.value;if(!t)return`请填写重复密码`;if(t!==e.parent?.child(`newPassword1`)?.value)return`重复密码与新密码不一致`}}}},u={fields:[{field:`password`},{field:`newPassword1`},{field:`newPassword2`}]},d={documentScripts:{setPassword(n){let i=n.document?.id;if(!i)return;let a=document.createElement(`dialog`),o=document.createElement(`form`),s=o.appendChild(document.createElement(`h2`));s.textContent=`设置用户密码`,a.appendChild(o);let c=new AbortController;a.addEventListener(`close`,()=>{a.remove(),c.abort()});let d=e.create(l);d.reset(),t(d,o,{editable:!0,layout:u,signal:c.signal});let f=o.appendChild(document.createElement(`button`));f.type=`submit`,f.textContent=`修改密码`,o.addEventListener(`submit`,async e=>{if(e.preventDefault(),!f.disabled)try{f.disabled=!0;let{password:e,newPassword1:t}=d.value;if((await d.validate())?.length)return;let n=await r.request.clone().put(`password`).body({userId:i,password:e,newPassword:t}).result();if(!n||n===200||typeof n==`object`){a.close(),alert(`密码修改完成`);return}if(n===404){alert(`新旧密码不能相同`);return}if(n===403){alert(`密码错误`);return}if(n===400){alert(`不能修改自己的密码`);return}if(n===402){alert(`您无操作权限`);return}}catch(e){e instanceof Response&&e.status===403&&alert(`密码错误`)}finally{f.disabled=!1}}),document.body.appendChild(a),a.showModal()}}},f={password:{type:`string`,label:`当前密码`,component:`password`,validators:{blur(e){let t=e.value;if(!t||typeof t!=`string`)return`请填写密码`}}},newPassword1:{type:`string`,label:`新密码`,component:`password`,validators:{blur(e){let t=e.value;return!t||typeof t!=`string`?`请填写新密码`:[...s(t)]}}},newPassword2:{type:`string`,label:`重复密码`,component:`password`,validators:{blur(e){let t=e.value;if(!t)return`请填写重复密码`;if(t!==e.parent?.child(`newPassword1`)?.value)return`重复密码与新密码不一致`}}}},p={fields:[{field:`password`},{field:`newPassword1`},{field:`newPassword2`}]};function m(n){n.loading=!1,n.panel=!0,n.title=`修改密码`;let i=n.container;i.style.margin=`auto`,i.style.maxInlineSize=`300px`;let a=document.createElement(`form`),o=a.appendChild(document.createElement(`h2`));o.textContent=`修改密码`,i.appendChild(a);let s=e.create(f);if(s.reset(),n.signal.aborted)return null;t(s,a,{editable:!0,layout:p,signal:n.signal});let c=a.appendChild(document.createElement(`button`));c.type=`submit`,c.textContent=`修改密码`,a.addEventListener(`submit`,async e=>{if(e.preventDefault(),!c.disabled)try{c.disabled=!0;let{password:e,newPassword1:t}=s.value;if((await s.validate())?.length)return;let n=await r.request.clone().put(`password`).body({password:e,newPassword:t}).result();if(!n||n===200||typeof n==`object`){s.reset(),alert(`密码修改完成`);return}if(n===403){alert(`密码错误`);return}}catch(e){e instanceof Response&&e.status===403&&alert(`密码错误`)}finally{c.disabled=!1}})}export{c as models,m as password,s as verifyNewPassword};
1
+ import{Store as e,User as t,renderStoreForm as n}from"@yongdall/web";import r from"@yongdall/web/plugin";var i=Object.defineProperty,a=(e,t)=>{let n={};for(var r in e)i(n,r,{get:e[r],enumerable:!0});return t||i(n,Symbol.toStringTag,{value:`Module`}),n};const o=[/[a-z]/,/[A-Z]/,/[0-9]/,/[~!@#$%^&*()_+{}|<>?,./:";'\\\[\]-]/];function*s(e){e.length<8&&(yield`密码不足 8 位`),o.filter(t=>t.test(e)).length<3&&(yield`密码至少包含小写字母、大写字母、数字、符号中的 3 种`),e.toLowerCase().includes(`admin`)&&(yield`密码不能包含admin`),[...e].find((e,t,n)=>n[t-1]===e&&n[t+1]===e)&&(yield`密码不能包含三位以上的相同的字母或数字`),[...e].find((e,t,n)=>{let r=n[t-1],i=n[t+1];if(!r||!i)return!1;let a=r.charCodeAt(0),o=e.charCodeAt(0),s=i.charCodeAt(0),c=a-o,l=o-s;if(c===l&&(l===1||l===-1))return!0})&&(yield`密码不能包含三位以上的连续的字母或数字`)}var c=a({user:()=>d});const l={password:{type:`string`,label:`您的密码`,component:`password`,hidden:()=>!t.multi,validators:{blur(e){if(!t.multi)return;let n=e.value;if(!n||typeof n!=`string`)return`请填写您的密码`}}},newPassword1:{type:`string`,label:`新密码`,component:`password`,validators:{blur(e){let t=e.value;return!t||typeof t!=`string`?`请填写新密码`:[...s(t)]}}},newPassword2:{type:`string`,label:`重复密码`,component:`password`,validators:{blur(e){let t=e.value;if(!t)return`请填写重复密码`;if(t!==e.parent?.child(`newPassword1`)?.value)return`重复密码与新密码不一致`}}}},u={fields:[{field:`password`},{field:`newPassword1`},{field:`newPassword2`}]},d={documentScripts:{setPassword(t){let i=t.document?.id;if(!i)return;let a=document.createElement(`dialog`),o=document.createElement(`form`),s=o.appendChild(document.createElement(`h2`));s.textContent=`设置用户密码`,a.appendChild(o);let c=new AbortController;a.addEventListener(`close`,()=>{a.remove(),c.abort()});let d=e.create(l);d.reset(),n(d,o,{editable:!0,layout:u,signal:c.signal});let f=o.appendChild(document.createElement(`button`));f.type=`submit`,f.textContent=`修改密码`,o.addEventListener(`submit`,async e=>{if(e.preventDefault(),!f.disabled)try{f.disabled=!0;let{password:e,newPassword1:t}=d.value;if((await d.validate())?.length)return;let n=await r.request.clone().put(`password`).body({userId:i,password:e,newPassword:t}).result();if(!n||n===200||typeof n==`object`){a.close(),alert(`密码修改完成`);return}if(n===404){alert(`新旧密码不能相同`);return}if(n===403){alert(`密码错误`);return}if(n===400){alert(`不能修改自己的密码`);return}if(n===402){alert(`您无操作权限`);return}}catch(e){e instanceof Response&&e.status===403&&alert(`密码错误`)}finally{f.disabled=!1}}),document.body.appendChild(a),a.showModal()}}},f={password:{type:`string`,label:`当前密码`,component:`password`,validators:{blur(e){let t=e.value;if(!t||typeof t!=`string`)return`请填写密码`}}},newPassword1:{type:`string`,label:`新密码`,component:`password`,validators:{blur(e){let t=e.value;return!t||typeof t!=`string`?`请填写新密码`:[...s(t)]}}},newPassword2:{type:`string`,label:`重复密码`,component:`password`,validators:{blur(e){let t=e.value;if(!t)return`请填写重复密码`;if(t!==e.parent?.child(`newPassword1`)?.value)return`重复密码与新密码不一致`}}}},p={fields:[{field:`password`},{field:`newPassword1`},{field:`newPassword2`}]};function m(t){t.loading=!1,t.panel=!0,t.title=`修改密码`;let i=t.container;i.style.margin=`auto`,i.style.maxInlineSize=`300px`;let a=document.createElement(`form`),o=a.appendChild(document.createElement(`h2`));o.textContent=`修改密码`,i.appendChild(a);let s=e.create(f);if(s.reset(),t.signal.aborted)return null;n(s,a,{editable:!0,layout:p,signal:t.signal});let c=a.appendChild(document.createElement(`button`));c.type=`submit`,c.textContent=`修改密码`,a.addEventListener(`submit`,async e=>{if(e.preventDefault(),!c.disabled)try{c.disabled=!0;let{password:e,newPassword1:t}=s.value;if((await s.validate())?.length)return;let n=await r.request.clone().put(`password`).body({password:e,newPassword:t}).result();if(!n||n===200||typeof n==`object`){s.reset(),alert(`密码修改完成`);return}if(n===403){alert(`密码错误`);return}}catch(e){e instanceof Response&&e.status===403&&alert(`密码错误`)}finally{c.disabled=!1}})}export{c as models,m as password,s as verifyNewPassword};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["schema","layout"],"sources":["../../../plugins/user/common/verifyNewPassword.mjs","../../../plugins/user/assets/models.mjs","../../../plugins/user/assets/password.mjs"],"sourcesContent":["const signTypeRegex = [\n\t/[a-z]/,\n\t/[A-Z]/,\n\t/[0-9]/,\n\t/[~!@#$%^&*()_+{}|<>?,./:\";'\\\\\\[\\]-]/,\n]\n/**\n * \n * @param {string} password \n */\nexport function* verifyNewPassword(password) {\n\tif (password.length < 8) { yield '密码不足 8 位'; }\n\t\n\tif (signTypeRegex.filter(r => r.test(password)).length < 3) {\n\t\tyield `密码至少包含小写字母、大写字母、数字、符号中的 3 种`;\n\t}\n\tif (password.toLowerCase().includes('admin')) {\n\t\tyield `密码不能包含admin`;\n\t}\n\tif ([...password].find((a,index, list) => list[index - 1] === a && list[index + 1] === a)) {\n\t\tyield `密码不能包含三位以上的相同的字母或数字`;\n\t}\n\tif ([...password].find((a,index, list) => {\n\t\tconst p = list[index - 1];\n\t\tconst n = list[index + 1];\n\t\tif (!p || !n) { return false; }\n\t\tconst x = p.charCodeAt(0);\n\t\tconst y = a.charCodeAt(0);\n\t\tconst z = n.charCodeAt(0);\n\t\tconst u = x - y;\n\t\tconst v = y - z;\n\t\tif (u === v && (v === 1 || v === -1)) { return true}\n\t})) {\n\t\tyield `密码不能包含三位以上的连续的字母或数字`;\n\t}\n}\n","/** @import { ModelScript } from '@yongdall/web' */\n/** @import { Schema, StoreLayout } from '@yongdall/web' */\n\nimport { renderStoreForm, single, Store } from '@yongdall/web';\nimport Plugin from '@yongdall/web/plugin';\nimport { verifyNewPassword } from './common/verifyNewPassword.mjs';\n\n/** @type {Schema} */\nconst schema = {\n\n\tpassword: {\n\t\ttype: 'string', label: '您的密码', component: 'password',\n\t\thidden: single,\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tif (single) { return; }\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value || typeof value !== 'string') { return '请填写您的密码'; }\n\t\t\t},\n\t\t}\n\t},\n\tnewPassword1: {\n\t\ttype: 'string', label: '新密码', component: 'password',\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value || typeof value !== 'string') { return '请填写新密码'; }\n\t\t\t\treturn [...verifyNewPassword(value)];\n\t\t\t},\n\t\t},\n\t},\n\tnewPassword2: {\n\t\ttype: 'string', label: '重复密码', component: 'password',\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value) { return '请填写重复密码'; }\n\t\t\t\tif (value !== store.parent?.child('newPassword1')?.value) {\n\t\t\t\t\treturn '重复密码与新密码不一致';\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n};\n\n/** @type {StoreLayout<any>} */\nconst layout = {\n\tfields: [\n\t\t{ field: 'password' },\n\t\t{ field: 'newPassword1' },\n\t\t{ field: 'newPassword2' },\n\t],\n};\n/** @type {ModelScript} */\nexport const user = {\n\tdocumentScripts: {\n\t\tsetPassword(params) {\n\t\t\tconst userId = params.document?.id;\n\t\t\tif (!userId) { return; }\n\t\t\tconst dialog = document.createElement('dialog');\n\t\t\tconst form = document.createElement('form');\n\t\t\tconst title = form.appendChild(document.createElement('h2'));\n\t\t\ttitle.textContent = '设置用户密码';\n\t\t\tdialog.appendChild(form);\n\t\t\tconst ac = new AbortController();\n\t\t\tdialog.addEventListener('close', () => {\n\t\t\t\tdialog.remove();\n\t\t\t\tac.abort();\n\t\t\t});\n\t\t\tconst store = Store.create(schema);\n\t\t\tstore.reset();\n\n\t\t\trenderStoreForm(store, form, { editable: true, layout, signal: ac.signal });\n\n\t\t\tconst submitButton = form.appendChild(document.createElement('button'));\n\t\t\tsubmitButton.type = 'submit';\n\t\t\tsubmitButton.textContent = '修改密码';\n\n\t\t\tform.addEventListener('submit', async event => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (submitButton.disabled) { return; }\n\t\t\t\ttry {\n\t\t\t\t\tsubmitButton.disabled = true;\n\t\t\t\t\tconst { password, newPassword1 } = store.value;\n\t\t\t\t\tconst r = await store.validate();\n\t\t\t\t\tif (r?.length) { return; }\n\t\t\t\t\tconst result = await Plugin.request.clone().put('password').body({\n\t\t\t\t\t\tuserId, password, newPassword: newPassword1,\n\t\t\t\t\t}).result();\n\t\t\t\t\tif (!result || result === 200 || typeof result === 'object') {\n\t\t\t\t\t\tdialog.close();\n\t\t\t\t\t\talert('密码修改完成');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (result === 404) {\n\t\t\t\t\t\talert('新旧密码不能相同');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (result === 403) {\n\t\t\t\t\t\talert('密码错误');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (result === 400) {\n\t\t\t\t\t\talert('不能修改自己的密码');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (result === 402) {\n\t\t\t\t\t\talert('您无操作权限');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e instanceof Response) {\n\t\t\t\t\t\tif (e.status === 403) {\n\t\t\t\t\t\t\talert('密码错误');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tsubmitButton.disabled = false;\n\t\t\t\t}\n\t\t\t});\n\t\t\tdocument.body.appendChild(dialog);\n\t\t\tdialog.showModal();\n\t\t}\n\t}\n};\n","/** @import { PageContext, Schema, StoreLayout } from '@yongdall/web' */\n\nimport { renderStoreForm, Store } from '@yongdall/web';\nimport Plugin from '@yongdall/web/plugin';\nimport { verifyNewPassword } from './common/verifyNewPassword.mjs';\n\n/** @type {Schema} */\nconst schema = {\n\n\tpassword: {\n\t\ttype: 'string', label: '当前密码', component: 'password',\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value || typeof value !== 'string') { return '请填写密码'; }\n\t\t\t},\n\t\t}\n\t},\n\tnewPassword1: {\n\t\ttype: 'string', label: '新密码', component: 'password',\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value || typeof value !== 'string') { return '请填写新密码'; }\n\t\t\t\treturn [...verifyNewPassword(value)];\n\t\t\t},\n\t\t},\n\t},\n\tnewPassword2: {\n\t\ttype: 'string', label: '重复密码', component: 'password',\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value) { return '请填写重复密码'; }\n\t\t\t\tif (value !== store.parent?.child('newPassword1')?.value) {\n\t\t\t\t\treturn '重复密码与新密码不一致';\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n};\n\n/** @type {StoreLayout<any>} */\nconst layout = {\n\tfields: [\n\t\t{ field: 'password' },\n\t\t{ field: 'newPassword1' },\n\t\t{ field: 'newPassword2' },\n\t],\n};\n/**\n * \n * @param {PageContext} ctx \n */\nexport default function(ctx) {\n\tctx.loading = false;\n\tctx.panel = true;\n\tctx.title = '修改密码';\n\tconst container = ctx.container;\n\tcontainer.style.margin = 'auto';\n\tcontainer.style.maxInlineSize = '300px';\n\n\tconst form = document.createElement('form');\n\tconst title = form.appendChild(document.createElement('h2'));\n\ttitle.textContent = '修改密码';\n\tcontainer.appendChild(form);\n\n\tconst store = Store.create(schema);\n\tstore.reset();\n\tif (ctx.signal.aborted) {\n\t\treturn null;\n\t}\n\n\n\trenderStoreForm(store, form, { editable: true, layout, signal: ctx.signal });\n\n\n\tconst submitButton = form.appendChild(document.createElement('button'));\n\tsubmitButton.type = 'submit';\n\tsubmitButton.textContent = '修改密码';\n\n\tform.addEventListener('submit', async event => {\n\t\tevent.preventDefault();\n\t\tif (submitButton.disabled) { return; }\n\t\ttry {\n\t\t\tsubmitButton.disabled = true;\n\t\t\tconst { password, newPassword1 } = store.value;\n\t\t\tconst r = await store.validate();\n\t\t\tif (r?.length) { return; }\n\t\t\tconst result = await Plugin.request.clone().put('password').body({\n\t\t\t\tpassword, newPassword: newPassword1,\n\t\t\t}).result();\n\t\t\tif (!result || result === 200 || typeof result === 'object') {\n\t\t\t\tstore.reset();\n\t\t\t\talert('密码修改完成');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (result === 403) {\n\t\t\t\talert('密码错误');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t} catch (e) {\n\t\t\tif (e instanceof Response) {\n\t\t\t\tif (e.status === 403) {\n\t\t\t\t\talert('密码错误');\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tsubmitButton.disabled = false;\n\t\t}\n\t});\n}\n"],"mappings":"+PAAA,MAAM,EAAgB,CACrB,QACA,QACA,QACA,sCACA,CAKD,SAAiB,EAAkB,EAAU,CACxC,EAAS,OAAS,IAAK,KAAM,YAE7B,EAAc,OAAO,GAAK,EAAE,KAAK,EAAS,CAAC,CAAC,OAAS,IACxD,KAAM,+BAEH,EAAS,aAAa,CAAC,SAAS,QAAQ,GAC3C,KAAM,eAEH,CAAC,GAAG,EAAS,CAAC,MAAM,EAAE,EAAO,IAAS,EAAK,EAAQ,KAAO,GAAK,EAAK,EAAQ,KAAO,EAAE,GACxF,KAAM,uBAEH,CAAC,GAAG,EAAS,CAAC,MAAM,EAAE,EAAO,IAAS,CACzC,IAAM,EAAI,EAAK,EAAQ,GACjB,EAAI,EAAK,EAAQ,GACv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EAAS,MAAM,EAAO,QAAQ,OAAO,CAAC,IAAI,WAAW,CAAC,KAAK,CAChE,WAAU,YAAa,EACvB,CAAC,CAAC,QAAQ,CACX,GAAI,CAAC,GAAU,IAAW,KAAO,OAAO,GAAW,SAAU,CAC5D,EAAM,OAAO,CACb,MAAM,SAAS,CACf,OAED,GAAI,IAAW,IAAK,CACnB,MAAM,OAAO,CACb,cAGO,EAAG,CACP,aAAa,UACZ,EAAE,SAAW,KAChB,MAAM,OAAO,QAGN,CACT,EAAa,SAAW,KAExB"}
1
+ {"version":3,"file":"index.mjs","names":["schema","layout"],"sources":["../../../plugins/user/common/verifyNewPassword.mjs","../../../plugins/user/assets/models.mjs","../../../plugins/user/assets/password.mjs"],"sourcesContent":["const signTypeRegex = [\n\t/[a-z]/,\n\t/[A-Z]/,\n\t/[0-9]/,\n\t/[~!@#$%^&*()_+{}|<>?,./:\";'\\\\\\[\\]-]/,\n]\n/**\n * \n * @param {string} password \n */\nexport function* verifyNewPassword(password) {\n\tif (password.length < 8) { yield '密码不足 8 位'; }\n\t\n\tif (signTypeRegex.filter(r => r.test(password)).length < 3) {\n\t\tyield `密码至少包含小写字母、大写字母、数字、符号中的 3 种`;\n\t}\n\tif (password.toLowerCase().includes('admin')) {\n\t\tyield `密码不能包含admin`;\n\t}\n\tif ([...password].find((a,index, list) => list[index - 1] === a && list[index + 1] === a)) {\n\t\tyield `密码不能包含三位以上的相同的字母或数字`;\n\t}\n\tif ([...password].find((a,index, list) => {\n\t\tconst p = list[index - 1];\n\t\tconst n = list[index + 1];\n\t\tif (!p || !n) { return false; }\n\t\tconst x = p.charCodeAt(0);\n\t\tconst y = a.charCodeAt(0);\n\t\tconst z = n.charCodeAt(0);\n\t\tconst u = x - y;\n\t\tconst v = y - z;\n\t\tif (u === v && (v === 1 || v === -1)) { return true}\n\t})) {\n\t\tyield `密码不能包含三位以上的连续的字母或数字`;\n\t}\n}\n","/** @import { ModelScript } from '@yongdall/web' */\n/** @import { Schema, StoreLayout } from '@yongdall/web' */\n\nimport { renderStoreForm, Store, User } from '@yongdall/web';\nimport Plugin from '@yongdall/web/plugin';\nimport { verifyNewPassword } from './common/verifyNewPassword.mjs';\n\n/** @type {Schema} */\nconst schema = {\n\n\tpassword: {\n\t\ttype: 'string', label: '您的密码', component: 'password',\n\t\thidden: () => !User.multi,\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tif (!User.multi) { return; }\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value || typeof value !== 'string') { return '请填写您的密码'; }\n\t\t\t},\n\t\t}\n\t},\n\tnewPassword1: {\n\t\ttype: 'string', label: '新密码', component: 'password',\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value || typeof value !== 'string') { return '请填写新密码'; }\n\t\t\t\treturn [...verifyNewPassword(value)];\n\t\t\t},\n\t\t},\n\t},\n\tnewPassword2: {\n\t\ttype: 'string', label: '重复密码', component: 'password',\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value) { return '请填写重复密码'; }\n\t\t\t\tif (value !== store.parent?.child('newPassword1')?.value) {\n\t\t\t\t\treturn '重复密码与新密码不一致';\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n};\n\n/** @type {StoreLayout<any>} */\nconst layout = {\n\tfields: [\n\t\t{ field: 'password' },\n\t\t{ field: 'newPassword1' },\n\t\t{ field: 'newPassword2' },\n\t],\n};\n/** @type {ModelScript} */\nexport const user = {\n\tdocumentScripts: {\n\t\tsetPassword(params) {\n\t\t\tconst userId = params.document?.id;\n\t\t\tif (!userId) { return; }\n\t\t\tconst dialog = document.createElement('dialog');\n\t\t\tconst form = document.createElement('form');\n\t\t\tconst title = form.appendChild(document.createElement('h2'));\n\t\t\ttitle.textContent = '设置用户密码';\n\t\t\tdialog.appendChild(form);\n\t\t\tconst ac = new AbortController();\n\t\t\tdialog.addEventListener('close', () => {\n\t\t\t\tdialog.remove();\n\t\t\t\tac.abort();\n\t\t\t});\n\t\t\tconst store = Store.create(schema);\n\t\t\tstore.reset();\n\n\t\t\trenderStoreForm(store, form, { editable: true, layout, signal: ac.signal });\n\n\t\t\tconst submitButton = form.appendChild(document.createElement('button'));\n\t\t\tsubmitButton.type = 'submit';\n\t\t\tsubmitButton.textContent = '修改密码';\n\n\t\t\tform.addEventListener('submit', async event => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (submitButton.disabled) { return; }\n\t\t\t\ttry {\n\t\t\t\t\tsubmitButton.disabled = true;\n\t\t\t\t\tconst { password, newPassword1 } = store.value;\n\t\t\t\t\tconst r = await store.validate();\n\t\t\t\t\tif (r?.length) { return; }\n\t\t\t\t\tconst result = await Plugin.request.clone().put('password').body({\n\t\t\t\t\t\tuserId, password, newPassword: newPassword1,\n\t\t\t\t\t}).result();\n\t\t\t\t\tif (!result || result === 200 || typeof result === 'object') {\n\t\t\t\t\t\tdialog.close();\n\t\t\t\t\t\talert('密码修改完成');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (result === 404) {\n\t\t\t\t\t\talert('新旧密码不能相同');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (result === 403) {\n\t\t\t\t\t\talert('密码错误');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (result === 400) {\n\t\t\t\t\t\talert('不能修改自己的密码');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (result === 402) {\n\t\t\t\t\t\talert('您无操作权限');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (e instanceof Response) {\n\t\t\t\t\t\tif (e.status === 403) {\n\t\t\t\t\t\t\talert('密码错误');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tsubmitButton.disabled = false;\n\t\t\t\t}\n\t\t\t});\n\t\t\tdocument.body.appendChild(dialog);\n\t\t\tdialog.showModal();\n\t\t}\n\t}\n};\n","/** @import { PageContext, Schema, StoreLayout } from '@yongdall/web' */\n\nimport { renderStoreForm, Store } from '@yongdall/web';\nimport Plugin from '@yongdall/web/plugin';\nimport { verifyNewPassword } from './common/verifyNewPassword.mjs';\n\n/** @type {Schema} */\nconst schema = {\n\n\tpassword: {\n\t\ttype: 'string', label: '当前密码', component: 'password',\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value || typeof value !== 'string') { return '请填写密码'; }\n\t\t\t},\n\t\t}\n\t},\n\tnewPassword1: {\n\t\ttype: 'string', label: '新密码', component: 'password',\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value || typeof value !== 'string') { return '请填写新密码'; }\n\t\t\t\treturn [...verifyNewPassword(value)];\n\t\t\t},\n\t\t},\n\t},\n\tnewPassword2: {\n\t\ttype: 'string', label: '重复密码', component: 'password',\n\t\tvalidators: {\n\t\t\tblur(store) {\n\t\t\t\tconst value = store.value;\n\t\t\t\tif (!value) { return '请填写重复密码'; }\n\t\t\t\tif (value !== store.parent?.child('newPassword1')?.value) {\n\t\t\t\t\treturn '重复密码与新密码不一致';\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n};\n\n/** @type {StoreLayout<any>} */\nconst layout = {\n\tfields: [\n\t\t{ field: 'password' },\n\t\t{ field: 'newPassword1' },\n\t\t{ field: 'newPassword2' },\n\t],\n};\n/**\n * \n * @param {PageContext} ctx \n */\nexport default function(ctx) {\n\tctx.loading = false;\n\tctx.panel = true;\n\tctx.title = '修改密码';\n\tconst container = ctx.container;\n\tcontainer.style.margin = 'auto';\n\tcontainer.style.maxInlineSize = '300px';\n\n\tconst form = document.createElement('form');\n\tconst title = form.appendChild(document.createElement('h2'));\n\ttitle.textContent = '修改密码';\n\tcontainer.appendChild(form);\n\n\tconst store = Store.create(schema);\n\tstore.reset();\n\tif (ctx.signal.aborted) {\n\t\treturn null;\n\t}\n\n\n\trenderStoreForm(store, form, { editable: true, layout, signal: ctx.signal });\n\n\n\tconst submitButton = form.appendChild(document.createElement('button'));\n\tsubmitButton.type = 'submit';\n\tsubmitButton.textContent = '修改密码';\n\n\tform.addEventListener('submit', async event => {\n\t\tevent.preventDefault();\n\t\tif (submitButton.disabled) { return; }\n\t\ttry {\n\t\t\tsubmitButton.disabled = true;\n\t\t\tconst { password, newPassword1 } = store.value;\n\t\t\tconst r = await store.validate();\n\t\t\tif (r?.length) { return; }\n\t\t\tconst result = await Plugin.request.clone().put('password').body({\n\t\t\t\tpassword, newPassword: newPassword1,\n\t\t\t}).result();\n\t\t\tif (!result || result === 200 || typeof result === 'object') {\n\t\t\t\tstore.reset();\n\t\t\t\talert('密码修改完成');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (result === 403) {\n\t\t\t\talert('密码错误');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t} catch (e) {\n\t\t\tif (e instanceof Response) {\n\t\t\t\tif (e.status === 403) {\n\t\t\t\t\talert('密码错误');\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tsubmitButton.disabled = false;\n\t\t}\n\t});\n}\n"],"mappings":"6PAAA,MAAM,EAAgB,CACrB,QACA,QACA,QACA,sCACA,CAKD,SAAiB,EAAkB,EAAU,CACxC,EAAS,OAAS,IAAK,KAAM,YAE7B,EAAc,OAAO,GAAK,EAAE,KAAK,EAAS,CAAC,CAAC,OAAS,IACxD,KAAM,+BAEH,EAAS,aAAa,CAAC,SAAS,QAAQ,GAC3C,KAAM,eAEH,CAAC,GAAG,EAAS,CAAC,MAAM,EAAE,EAAO,IAAS,EAAK,EAAQ,KAAO,GAAK,EAAK,EAAQ,KAAO,EAAE,GACxF,KAAM,uBAEH,CAAC,GAAG,EAAS,CAAC,MAAM,EAAE,EAAO,IAAS,CACzC,IAAM,EAAI,EAAK,EAAQ,GACjB,E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IADU,MAAM,EAAM,UAAU,GACzB,OAAU,OACjB,IAAM,EAAS,MAAM,EAAO,QAAQ,OAAO,CAAC,IAAI,WAAW,CAAC,KAAK,CAChE,WAAU,YAAa,EACvB,CAAC,CAAC,QAAQ,CACX,GAAI,CAAC,GAAU,IAAW,KAAO,OAAO,GAAW,SAAU,CAC5D,EAAM,OAAO,CACb,MAAM,SAAS,CACf,OAED,GAAI,IAAW,IAAK,CACnB,MAAM,OAAO,CACb,cAGO,EAAG,CACP,aAAa,UACZ,EAAE,SAAW,KAChB,MAAM,OAAO,QAGN,CACT,EAAa,SAAW,KAExB"}
package/index.d.mts CHANGED
@@ -1,33 +1,33 @@
1
- import * as imodel3 from "imodel";
1
+ import * as imodel0 from "imodel";
2
2
  import * as _yongdall_model0 from "@yongdall/model";
3
3
 
4
4
  //#region plugins/user/models/User.d.mts
5
5
  declare const _default: _yongdall_model0.ModelTable<{
6
- username: imodel3.FieldDefine<_yongdall_model0.ModelTable<{
7
- account: imodel3.FieldDefine<"string", false, false>;
8
- userId: imodel3.FieldDefine<"uuid", false, false>;
9
- type: imodel3.FieldDefine<"string", false, false>;
6
+ username: imodel0.FieldDefine<_yongdall_model0.ModelTable<{
7
+ account: imodel0.FieldDefine<"string", false, false>;
8
+ userId: imodel0.FieldDefine<"uuid", false, false>;
9
+ type: imodel0.FieldDefine<"string", false, false>;
10
10
  }, "user.account">, false, false>;
11
- id: imodel3.FieldDefine<"uuid", false, false>;
12
- name: imodel3.FieldDefine<"string", false, false>;
13
- enabled: imodel3.FieldDefine<"bool", false, false>;
14
- createdAt: imodel3.FieldDefine<"timestamp", false, false>;
15
- updatedAt: imodel3.FieldDefine<"timestamp", false, false>;
11
+ id: imodel0.FieldDefine<"uuid", false, false>;
12
+ name: imodel0.FieldDefine<"string", false, false>;
13
+ enabled: imodel0.FieldDefine<"bool", false, false>;
14
+ createdAt: imodel0.FieldDefine<"timestamp", false, false>;
15
+ updatedAt: imodel0.FieldDefine<"timestamp", false, false>;
16
16
  }, "user">;
17
17
  //#endregion
18
18
  //#region plugins/user/models/UserAccount.d.mts
19
19
  declare const _default$1: _yongdall_model0.ModelTable<{
20
- account: imodel3.FieldDefine<"string", false, false>;
21
- userId: imodel3.FieldDefine<"uuid", false, false>;
22
- type: imodel3.FieldDefine<"string", false, false>;
20
+ account: imodel0.FieldDefine<"string", false, false>;
21
+ userId: imodel0.FieldDefine<"uuid", false, false>;
22
+ type: imodel0.FieldDefine<"string", false, false>;
23
23
  }, "user.account">;
24
24
  //#endregion
25
25
  //#region plugins/user/models/UserPassword.d.mts
26
26
  declare const _default$2: _yongdall_model0.ModelTable<{
27
- userId: imodel3.FieldDefine<"uuid", false, false>;
28
- password: imodel3.FieldDefine<"string", false, false>;
29
- deadline: imodel3.FieldDefine<"timestamp", false, true>;
30
- updatedAt: imodel3.FieldDefine<"timestamp", false, false>;
27
+ userId: imodel0.FieldDefine<"uuid", false, false>;
28
+ password: imodel0.FieldDefine<"string", false, false>;
29
+ deadline: imodel0.FieldDefine<"timestamp", false, true>;
30
+ updatedAt: imodel0.FieldDefine<"timestamp", false, false>;
31
31
  }, "user.password">;
32
32
  //#endregion
33
33
  //#region plugins/user/common/verifyNewPassword.d.mts
package/package.json CHANGED
@@ -6,23 +6,23 @@
6
6
  ".": "./index.mjs",
7
7
  "./assets": "./assets/index.mjs"
8
8
  },
9
- "version": "0.1.4",
9
+ "version": "0.3.0",
10
10
  "description": "",
11
11
  "keywords": [],
12
12
  "author": "",
13
13
  "license": "ISC",
14
14
  "dependencies": {
15
- "@yongdall/connection": "^0.1.0",
16
- "@yongdall/context": "^0.1.0",
17
- "@yongdall/model": "^0.1.0",
18
- "@yongdall/core": "^0.1.0",
19
- "@yongdall/http": "^0.1.0"
15
+ "@yongdall/connection": "^0.3.0",
16
+ "@yongdall/context": "^0.3.0",
17
+ "@yongdall/model": "^0.3.0",
18
+ "@yongdall/core": "^0.3.0",
19
+ "@yongdall/http": "^0.3.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@yongdall/web": "^0.1.0",
23
- "@yongdall/types": "^0.1.0"
22
+ "@yongdall/web": "^0.3.0",
23
+ "@yongdall/types": "^0.3.0"
24
24
  },
25
25
  "peerDependencies": {
26
- "@yongdall/web": "^0.1.0"
26
+ "@yongdall/web": "^0.3.0"
27
27
  }
28
28
  }