12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- /** layuiAdmin.pro-v1.2.1 LPPL License By http://www.layui.com/admin/ */
- ;
- layui.define(["form", "upload"],
- function(t) {
- var i = layui.$,
- e = layui.layer,
- n = (layui.laytpl, layui.setter, layui.view, layui.admin),
- a = layui.form,
- s = layui.upload;
- i("body");
- a.render(),
- a.verify({
- nickname: function(t, i) {
- return new RegExp("^[a-zA-Z0-9_一-龥\\s·]+$").test(t) ? /(^\_)|(\__)|(\_+$)/.test(t) ? "用户名首尾不能出现下划线'_'": /^\d+\d+\d$/.test(t) ? "用户名不能全为数字": void 0 : "用户名不能有特殊字符"
- },
- pass: [/^[\S]{3,12}$/, "密码必须3到12位,且不能出现空格"],
- repass: function(t) {
- if (t !== i("#LAY_password").val()) return "两次密码输入不一致"
- }
- }),
- a.on("submit(set_website)",
- function(t) {
- return e.msg(JSON.stringify(t.field)),
- !1
- }),
- a.on("submit(set_system_email)",
- function(t) {
- return e.msg(JSON.stringify(t.field)),
- !1
- }),
- a.on("submit(setmyinfo)",
- function(t) {
- return e.msg(JSON.stringify(t.field)),
- !1
- });
- var r = i("#LAY_avatarSrc");
- s.render({
- url: "/api/upload/",
- elem: "#LAY_avatarUpload",
- done: function(t) {
- 0 == t.status ? r.val(t.url) : e.msg(t.msg, {
- icon: 5
- })
- }
- }),
- n.events.avartatPreview = function(t) {
- var i = r.val();
- e.photos({
- photos: {
- title: "查看头像",
- data: [{
- src: i
- }]
- },
- shade: .01,
- closeBtn: 1,
- anim: 5
- })
- },
- a.on("submit(setmypass)",
- function(t) {
- // return e.msg(JSON.stringify(t.field)),
- // !1
- var data = {
- "oldPassword":hex_md5(t.field.oldPassword),
- "password":hex_md5(t.field.password),
- "repassword":hex_md5(t.field.repassword)
- }
- // layui.admin.req({
- n.req({
- url:'/login/pw',
- type:'post',
- data:data,
- done:function (res) {
- // console.log(res)
- layer.msg(res.msg);
- i('#LAY_old_password').val('');
- i('#LAY_password').val('');
- i('#LAY_re_password').val('');
- // a.render()
- }
- })
- }),
- t("set", {})
- });
|