/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 40687:
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {


// EXTERNAL MODULE: ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
var runtime_dom_esm_bundler = __webpack_require__(49242);
// EXTERNAL MODULE: ./node_modules/ant-design-vue/es/index.js + 2 modules
var es = __webpack_require__(46639);
// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(73396);
// EXTERNAL MODULE: ./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
var reactivity_esm_bundler = __webpack_require__(44870);
// EXTERNAL MODULE: ./node_modules/axios/lib/axios.js + 9 modules
var axios = __webpack_require__(29965);
// EXTERNAL MODULE: ./node_modules/js-cookie/dist/js.cookie.mjs
var js_cookie = __webpack_require__(50680);
;// CONCATENATED MODULE: ./src/utils/request.ts


const API_PROXY_PREFIX = '/adminapi';
// const BASE_URL = process.env.NODE_ENV === 'production' ? process.env.VUE_APP_API_URL : API_PROXY_PREFIX
// const BASE_URL = process.env.VUE_APP_API_URL
const BASE_URL = 'https://shop.h888.fun/adminapi/v1';
// 跨域認證資訊 header 名
const api = axios/* default.create */.Z.create({
  baseURL: BASE_URL,
  headers: {
    'Content-Type': 'application/json'
  }
});
api.defaults.timeout = 5000;
api.defaults.withCredentials = true;
api.defaults.xsrfHeaderName = 'Authorization';
api.defaults.xsrfCookieName = 'Authorization';
/**
 * axios請求
 * @param url 請求地址
 * @param method {METHOD} http method
 * @param params 請求參數
 * @returns {Promise<AxiosResponse<T>>}
 */
async function request(url, data, type = 'GET') {
  let result;
  if (type.toUpperCase() === 'GET') {
    let queryStr = '';
    Object.keys(data).forEach(key => {
      queryStr += key + '=' + data[key] + '&';
    });
    if (queryStr !== '') {
      queryStr = queryStr.substring(0, queryStr.lastIndexOf('&'));
      url += '?' + queryStr;
    }
    result = await api.get(url);
  } else {
    result = await api.post(url, data);
  }
  return result.data;
}
/**
 * 設定認證資訊
 * @param auth {Object}
 * @param authType {AUTH_TYPE} 認證類型，預設：{AUTH_TYPE.BEARER}
 */
function setAuthorization(auth) {
  // Cookie.set(xsrfHeaderName, 'Bearer ' + auth.token, {expires: auth.expireAt})
  js_cookie/* default.set */.Z.set('Authorization', 'Bearer ' + auth.token);
}
/**
 * 移出認證資訊
 * @param authType {AUTH_TYPE} 認證類型
 */
function removeAuthorization() {
  Cookie.remove('Authorization');
}
/**
 * 檢查認證資訊
 * @param authType
 * @returns {boolean}
 */
function checkAuthorization() {
  if (Cookie.get('Authorization')) {
    return true;
  }
  return false;
}

;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-41.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/pages/login/App.vue?vue&type=script&lang=ts&setup=true


const _withScopeId = n => ((0,runtime_core_esm_bundler/* pushScopeId */.dD)("data-v-bab24732"), n = n(), (0,runtime_core_esm_bundler/* popScopeId */.Cn)(), n);
const _hoisted_1 = {
  class: "login-box"
};
const _hoisted_2 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("div", {
  class: "login-logo"
}, "電商後台", -1));
const _hoisted_3 = {
  class: "card"
};
const _hoisted_4 = {
  class: "card-body login-card-body"
};
const _hoisted_5 = ["src", "onclick"];



/* harmony default export */ var Appvue_type_script_lang_ts_setup_true = (/*#__PURE__*/(0,runtime_core_esm_bundler/* defineComponent */.aZ)({
  __name: 'App',
  setup(__props) {
    const ifocus = (0,reactivity_esm_bundler/* ref */.iH)(null);
    (0,runtime_core_esm_bundler/* nextTick */.Y3)(() => {
      ifocus.value.focus();
    });
    const captchaImg = (0,reactivity_esm_bundler/* ref */.iH)(null);
    const captchaImgUrl = (0,reactivity_esm_bundler/* ref */.iH)('index.php?act=captcha&' + Math.random());
    const inputCaptcha = () => {
      formState.value.captcha = formState.value.captcha.toUpperCase();
    };
    const formState = (0,reactivity_esm_bundler/* ref */.iH)({
      username: "",
      password: "",
      captcha: "",
      remember: false
    });
    const onFinish = async values => {
      let res = await axios/* default.post */.Z.post('/admin/privilege.php?act=signin', values);
      if (res.data.code != '200') {
        captchaImgUrl.value = 'index.php?act=captcha&' + Math.random();
        visible.value = true;
        message.value = res.data.message;
        setTimeout(function () {
          visible.value = false;
        }, 3000);
        switch (res.data.code) {
          case '501':
            formState.value.captcha = '';
            break;
          default:
            formState.value.username = '';
            formState.value.password = '';
            formState.value.captcha = '';
            ifocus.value.focus();
        }
        return;
      }
      setAuthorization(res.data.code);
      window.location.href = 'index.php';
    };
    const onFinishFailed = errorInfo => {
      console.log('Login Failed');
    };
    const message = (0,reactivity_esm_bundler/* ref */.iH)('');
    const visible = (0,reactivity_esm_bundler/* ref */.iH)(false);
    const onClose = () => {};
    return (_ctx, _cache) => {
      const _component_a_alert = (0,runtime_core_esm_bundler/* resolveComponent */.up)("a-alert");
      const _component_a_input = (0,runtime_core_esm_bundler/* resolveComponent */.up)("a-input");
      const _component_a_form_item = (0,runtime_core_esm_bundler/* resolveComponent */.up)("a-form-item");
      const _component_a_input_password = (0,runtime_core_esm_bundler/* resolveComponent */.up)("a-input-password");
      const _component_a_checkbox = (0,runtime_core_esm_bundler/* resolveComponent */.up)("a-checkbox");
      const _component_a_button = (0,runtime_core_esm_bundler/* resolveComponent */.up)("a-button");
      const _component_a_form = (0,runtime_core_esm_bundler/* resolveComponent */.up)("a-form");
      return (0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", _hoisted_1, [_hoisted_2, (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_3, [(0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_4, [(0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_form, {
        model: formState.value,
        name: "basic",
        "wrapper-col": {
          span: 24
        },
        autocomplete: "off",
        onFinish: onFinish,
        onFinishFailed: onFinishFailed
      }, {
        default: (0,runtime_core_esm_bundler/* withCtx */.w5)(() => [visible.value ? ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createBlock */.j4)(_component_a_alert, {
          key: 0,
          type: "error",
          closable: true,
          message: message.value,
          onClose: onClose,
          showIcon: "",
          style: {
            "margin-bottom": "24px"
          }
        }, null, 8, ["message"])) : (0,runtime_core_esm_bundler/* createCommentVNode */.kq)("", true), (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_form_item, {
          name: "username",
          rules: [{
            required: true,
            message: '用戶帳號必填!'
          }]
        }, {
          default: (0,runtime_core_esm_bundler/* withCtx */.w5)(() => [(0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_input, {
            value: formState.value.username,
            "onUpdate:value": _cache[0] || (_cache[0] = $event => formState.value.username = $event),
            placeholder: "用戶帳號",
            ref_key: "ifocus",
            ref: ifocus
          }, null, 8, ["value"])]),
          _: 1
        }), (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_form_item, {
          name: "password",
          rules: [{
            required: true,
            message: '用戶密碼必填!'
          }]
        }, {
          default: (0,runtime_core_esm_bundler/* withCtx */.w5)(() => [(0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_input_password, {
            placeholder: "用戶密碼",
            value: formState.value.password,
            "onUpdate:value": _cache[1] || (_cache[1] = $event => formState.value.password = $event)
          }, null, 8, ["value"])]),
          _: 1
        }), (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_form_item, {
          name: "captcha",
          rules: [{
            required: true,
            message: '驗證碼必填!'
          }]
        }, {
          default: (0,runtime_core_esm_bundler/* withCtx */.w5)(() => [(0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_input, {
            value: formState.value.captcha,
            "onUpdate:value": _cache[2] || (_cache[2] = $event => formState.value.captcha = $event),
            placeholder: "驗證碼",
            onKeyup: inputCaptcha
          }, {
            addonAfter: (0,runtime_core_esm_bundler/* withCtx */.w5)(() => [(0,runtime_core_esm_bundler/* createElementVNode */._)("img", {
              src: captchaImgUrl.value,
              alt: "CAPTCHA",
              style: {
                "cursor": "pointer"
              },
              title: "點擊換一張",
              ref_key: "captchaImg",
              ref: captchaImg,
              onclick: `this.src='index.php?act=captcha&${Math.random()}'`
            }, null, 8, _hoisted_5)]),
            _: 1
          }, 8, ["value"])]),
          _: 1
        }), (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_form_item, {
          name: "remember",
          "wrapper-col": {
            span: 24
          }
        }, {
          default: (0,runtime_core_esm_bundler/* withCtx */.w5)(() => [(0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_checkbox, {
            checked: formState.value.remember,
            "onUpdate:checked": _cache[3] || (_cache[3] = $event => formState.value.remember = $event)
          }, {
            default: (0,runtime_core_esm_bundler/* withCtx */.w5)(() => [(0,runtime_core_esm_bundler/* createTextVNode */.Uk)("記住登入")]),
            _: 1
          }, 8, ["checked"])]),
          _: 1
        }), (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_form_item, {
          "wrapper-col": {
            span: 24
          }
        }, {
          default: (0,runtime_core_esm_bundler/* withCtx */.w5)(() => [(0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_a_button, {
            type: "primary",
            "html-type": "submit",
            block: ""
          }, {
            default: (0,runtime_core_esm_bundler/* withCtx */.w5)(() => [(0,runtime_core_esm_bundler/* createTextVNode */.Uk)("登入")]),
            _: 1
          })]),
          _: 1
        })]),
        _: 1
      }, 8, ["model"])])])]);
    };
  }
}));
;// CONCATENATED MODULE: ./src/pages/login/App.vue?vue&type=script&lang=ts&setup=true
 
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/pages/login/App.vue?vue&type=style&index=0&id=bab24732&lang=less&scoped=true
// extracted by mini-css-extract-plugin

;// CONCATENATED MODULE: ./src/pages/login/App.vue?vue&type=style&index=0&id=bab24732&lang=less&scoped=true

// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(40089);
;// CONCATENATED MODULE: ./src/pages/login/App.vue



;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(Appvue_type_script_lang_ts_setup_true, [['__scopeId',"data-v-bab24732"]])

/* harmony default export */ var App = (__exports__);
// EXTERNAL MODULE: ./node_modules/ant-design-vue/dist/antd.css
var antd = __webpack_require__(62467);
;// CONCATENATED MODULE: ./src/pages/login/main.ts




const app = (0,runtime_dom_esm_bundler/* createApp */.ri)(App);
app.use(es/* default */.ZP).mount('#app');

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = __webpack_modules__;
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/chunk loaded */
/******/ 	!function() {
/******/ 		var deferred = [];
/******/ 		__webpack_require__.O = function(result, chunkIds, fn, priority) {
/******/ 			if(chunkIds) {
/******/ 				priority = priority || 0;
/******/ 				for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
/******/ 				deferred[i] = [chunkIds, fn, priority];
/******/ 				return;
/******/ 			}
/******/ 			var notFulfilled = Infinity;
/******/ 			for (var i = 0; i < deferred.length; i++) {
/******/ 				var chunkIds = deferred[i][0];
/******/ 				var fn = deferred[i][1];
/******/ 				var priority = deferred[i][2];
/******/ 				var fulfilled = true;
/******/ 				for (var j = 0; j < chunkIds.length; j++) {
/******/ 					if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {
/******/ 						chunkIds.splice(j--, 1);
/******/ 					} else {
/******/ 						fulfilled = false;
/******/ 						if(priority < notFulfilled) notFulfilled = priority;
/******/ 					}
/******/ 				}
/******/ 				if(fulfilled) {
/******/ 					deferred.splice(i--, 1)
/******/ 					var r = fn();
/******/ 					if (r !== undefined) result = r;
/******/ 				}
/******/ 			}
/******/ 			return result;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	!function() {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/runtimeId */
/******/ 	!function() {
/******/ 		__webpack_require__.j = 535;
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/jsonp chunk loading */
/******/ 	!function() {
/******/ 		// no baseURI
/******/ 		
/******/ 		// object to store loaded and loading chunks
/******/ 		// undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ 		// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ 		var installedChunks = {
/******/ 			535: 0
/******/ 		};
/******/ 		
/******/ 		// no chunk on demand loading
/******/ 		
/******/ 		// no prefetching
/******/ 		
/******/ 		// no preloaded
/******/ 		
/******/ 		// no HMR
/******/ 		
/******/ 		// no HMR manifest
/******/ 		
/******/ 		__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };
/******/ 		
/******/ 		// install a JSONP callback for chunk loading
/******/ 		var webpackJsonpCallback = function(parentChunkLoadingFunction, data) {
/******/ 			var chunkIds = data[0];
/******/ 			var moreModules = data[1];
/******/ 			var runtime = data[2];
/******/ 			// add "moreModules" to the modules object,
/******/ 			// then flag all "chunkIds" as loaded and fire callback
/******/ 			var moduleId, chunkId, i = 0;
/******/ 			if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {
/******/ 				for(moduleId in moreModules) {
/******/ 					if(__webpack_require__.o(moreModules, moduleId)) {
/******/ 						__webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ 					}
/******/ 				}
/******/ 				if(runtime) var result = runtime(__webpack_require__);
/******/ 			}
/******/ 			if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ 			for(;i < chunkIds.length; i++) {
/******/ 				chunkId = chunkIds[i];
/******/ 				if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ 					installedChunks[chunkId][0]();
/******/ 				}
/******/ 				installedChunks[chunkId] = 0;
/******/ 			}
/******/ 			return __webpack_require__.O(result);
/******/ 		}
/******/ 		
/******/ 		var chunkLoadingGlobal = self["webpackChunkvue3"] = self["webpackChunkvue3"] || [];
/******/ 		chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ 		chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ 	}();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module depends on other loaded chunks and execution need to be delayed
/******/ 	var __webpack_exports__ = __webpack_require__.O(undefined, [998], function() { return __webpack_require__(40687); })
/******/ 	__webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/ 	
/******/ })()
;
//# sourceMappingURL=login.56632992.js.map