12345678910111213141516171819202122232425262728293031323334353637383940 |
- const state = {
- region: 'oss-cn-beijing',
- accessKeyId: 'LTAI5tJe94eBRuNzuVFyt1C2',
- accessKeySecret: 'YRhe8lc7vpbxX8Fi4qvosDqVERFdjJ',
- bucket: 'yangguzhineng',
- folder: 'test',
- progress: 0,
- ossBaseUrl: '',
- stsToken: ''
- }
- const mutations = {
- SET_REGION: (state, payload) => {
- state.region = payload
- },
- SET_ACCESS_KEY_ID: (state, payload) => {
- state.accessKeyId = payload
- },
- SET_ACCESS_KEY_SECRET: (state, payload) => {
- state.accessKeySecret = payload
- },
- SET_BUCKET: (state, payload) => {
- state.bucket = payload
- },
- SET_FOLDER: (state, payload) => {
- state.folder = payload
- },
- SET_PROGRESS: (state, payload) => {
- state.progress = payload
- },
- SET_OSS_BASE_URL: (state) => {
- state.ossBaseUrl = `https://${state.bucket}.${state.region}.aliyuncs.com/`
- }
- }
- const actions = {}
- export default {
- namespaced: true,
- state,
- mutations,
- actions
- }
|